The SpawnProjectile as seen in the HeliGun example proxy
A Spawn Projectile is an Intruder MM script that as expected, fires projectiles.
This script handles the actual spawning, movement, ammo, and firing cooldown of the projectile. Other scripts (like Heli Gun) can call it to fire automatically, but Spawn Projectile itself is the part that creates the projectile.
Properties
Projectile Settings
| Property |
Description
|
| Projectile Name |
Name/ID of the projectile to load
|
| Speed |
How fast the projectile is pushed forward
|
| Fire Rate |
Time between shots (in seconds)
|
| Can Fire |
Whether the spawner is currently allowed to shoot
|
| Spread |
Random angle variation applied to shots
|
Ammo Settings
| Property |
Description
|
| Current Ammo |
How much ammo is currently available
|
| Default Ammo |
Ammo amount reset to each round (-1 means infinite)
|
Position Settings
| Property |
Description
|
| Forward Offset |
Distance in front of the object where the projectile spawns
|
| Use Local Pos |
Uses local position instead of world position
|
Sound & Visual Options
| Property |
Description
|
| Play Sound |
Plays a sound when firing
|
| Animation |
Animation played when firing
|
How firing works
The projectile can be fired via Activator by calling:
NetSpawn()
This function:
- Checks if the spawner can fire
- Spawns the projectile slightly in front of the object
- Applies forward force based on Speed
- Applies spread (if set)
- Reduces ammo (if limited)
- Waits for Fire Rate before allowing the next shot