WeaponType
const WeaponType = { HITSCAN: 'hitscan', PROJECTILE: 'projectile', HYBRID: 'hybrid', }Weapon types for the unified weapon system.
Controls how weapons behave:
- HITSCAN: Instant raycast damage (rifles, pistols, lasers)
- PROJECTILE: Traveling physics-based (arrows, grenades, rockets)
- HYBRID: Instant damage + visual projectile travel (competitive FPS feel)
Example
import { WeaponType } from '@three-blocks/pro';
// Hitscan rifle
physics.weapons.fire(shooterIndex, {
type: WeaponType.HITSCAN,
direction: [0, 0, 1],
damage: 25,
});
// Projectile arrow
physics.weapons.fire(towerIndex, {
type: WeaponType.PROJECTILE,
direction: aimDir,
damage: 30,
...ProjectilePreset.ARROW,
});
// Hybrid (instant hit + visual bullet)
physics.weapons.fire(shooterIndex, {
type: WeaponType.HYBRID,
direction: forward,
damage: 20,
projectileSpeed: 200,
});