Spawn on Event LPK_SpawnOnEvent.cs

This component can be attached to any object to cause it to spawn a game object upon receiving an event.

Suggested use:

Spawn any object or prefab when an event is receieved. If you spawn instances of an object that is not a prefab, it spawns clones, and it will not work the same way with collision and other triggers.

Examples found in: Project 5

Components
Property Type Description Default Value
Component Properties
Prefab Object What prefab to instantiate upon receiving the event. None
Spawns Per Event Integer How many instances of the prefab to spawn every time an event is received. 1
Max Spawns Integer Total maximum number of instances this component is allowed to spawn. (0 means no limit). 0
Cooldown Float Amount of time to wait (in seconds) until an event can trigger another spawn. 0
Spawn Position Properties
Position Spawn Mode LPK Non Numeric Modify Mode Mode for how to select the position to spawn a game object with. SET
Spawn Position Vector3 Transform whose position will be the spawn location. 0,0,0
Rotation Spawn Mode LPK Non Numeric Modify Mode Mode for how to select the rotation to spawn a game object with. SET
Spawn Rotation Vector3 Transform whose angles will be used for the spawned game object. 0,0,0
Translation Offset Variance Vector3 Random translational variance applied to the spawn position. A value of (2, 0, 0) will apply a random offset of -2 to 2 to the X value of the spawn position 0,0,0
Rotational Offset Variance Vector3 Random angular variance applied to the spawned object's angles. 0,0,0
Event Receiving Info
Event Trigger LPK Event Object Which event will trigger this component's action. None
Game Object Spawned Event Sending Info
Event LPK Event Object Event to dispatch when conditions are met:
  • When the game object is spawned, as specified in Component & Spawn Position Properties.
None
Event Sending Mode LPK Event Sending Mode Who receives the event sent info when input is given from the input device. OWNER = only send to components on the same game object. ALL = send to all game objects. TAGS = send to specified tags. TAGS
Event Sending Mode - TAGS
Tags Array of Tags Which tags will receive this event. 0
Debug Properties
Print Debug Info Boolean Toggle console debug messages. False
Label String Notes for the user about this component. This does nothing to the game or build. None