Component > Pixel Crushers > Dialogue System > Actor > Range Trigger
Range Trigger activates GameObjects and/or components only when the player is within its trigger area.
Property | Function |
---|---|
Condition | The conditions required to enable the GameObjects and/or components. |
Game Objects | The GameObjects to enable. |
Components | The components to enable. |
OnEnter() | UnityEvent that runs when the player enters the trigger area. |
OnExit() | UnityEvent that runs when the player exits the trigger area. |
This component enables GameObjects and/or components only when it receives OnTriggerEnter/OnTriggerEnter2D messages, and disables them when it receives OnTriggerExit/OnTriggerExit2D messages. You will typically add this to a child GameObject of an actor. Give the child a trigger collider, and set the layer to detect collisions with the intended GameObject (e.g., the player).
Range Trigger is useful to ensure that actors only bark when the player is nearby.