Projectile Barrel
The ProjectileBarrel
is a base barrel extension that launches physical projectiles instead of using raycasts. This allows for slower, arcing, or visually persistent munitions—ideal for grenades, rockets, or fantasy spells.
✅ Ideal For
- Grenade launchers
- RPGs
- Magic spells
- Plasma or energy projectiles
⚙️ How it works
Each time the barrel fires:
- A projectile prefab is spawned at the barrel’s spawn point.
- The projectile handles its own movement and collision.
- Damage and effects are triggered when the projectile hits something or after a delay.
Note
Because the projectile is a separate GameObject, it allows for more dynamic behavior like gravity, bounce, and trail effects.
📐 Additional Settings
Aside from the base barrel logic, the projectile barrel introduces new settings highlighted in the red box in the image below
Field | Description |
---|---|
Projectile Prefab | The prefab that will be instantiated and launched when firing. |
Damage Points | Damage applied by the projectile on impact. |
Pooled | Whether the projectile is spawned using object pooling (recommended for performance). |
Prewarm Count | Number of projectiles to pre-instantiate if pooling is enabled. |
On Projectile Spawned (Projectile) | Event triggered after the projectile has been instantiated. Use this to initialize logic, add VFX, or attach metadata. |