SpawnProjectile

From Superboss Games Wiki
Jump to navigation Jump to search
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:

  1. Checks if the spawner can fire
  2. Spawns the projectile slightly in front of the object
  3. Applies forward force based on Speed
  4. Applies spread (if set)
  5. Reduces ammo (if limited)
  6. Waits for Fire Rate before allowing the next shot
IntruderMM Assets
Items Name
Prefabs BriefcaseProxy - CustomDoorProxy - DoorProxy - EquipmentManager - GlassProxy - GoalPointProxy - Keypad - Ladder - LockedObject - MortarProxy - Mover Parent - NoteProxy - ObserveCamProxy - Pickup - RandomGunPickup - RandomItemPickup - SecuritySetup - SlidingDoor - SpawnA - SpawnB - WaterLevel - WindProxy - ZipLine - Limits
Scripts ActivateActivator - Activator - AdvancedMaterial - AnimateColor - BriefcaseProxy (Script) - CustomDoorProxy - CustomLevelSettings - CustomMapSkins - DestructibleProxy - DoorProxy - EquipmentManager - GlassProxy - GoalPointProxy - GravityProxy - HackModeProxy - HideOnStart - IgnoreSticky - KeypadProxy - LayerProxy - LockedObject - MaterialManager - MortarProxy - Mover - NoteProxy - NudgeZone - SlipZone - ObjectiveTabSettings - ObjectTagger - ObserveCamProxy - PickupProxy - PlayAudio - ProjectileSpawn - ReplaceAll - ResetProxy - ScrollingUVs - SecurityRoom - SecurityScreen - HeliGun - SightSensor - SpawnProjectile - SetTagsAndLayers - SoundSettings - TimedObjectDestroyer - TuningProxy - WindProxy - World Screen Object - ZiplineProxy
Level/Maps Target - SniperRange - Demo