OnTriggerEnter

Syntax:

 begin OnTriggerEnter TriggeringRefID (optional) 

This is reported when a new ref is added to the trigger's list. The newly added ref is set as the action ref on the trigger (as reported by IsActionRef and GetActionRef). Only one enter action may be triggered per frame. If two refs enter the trigger the same frame, only one is added to the list so that the other ref will be added next frame. (Meaning you are guaranteed to always get an OnTriggerEnter for every actor that enters a trigger box.)

If the parameter is specified, the block is run only if the specified ref is the one entering the trigger box. Otherwise, the block is run when any ref enters the trigger box.

NotesEdit

  • Very thin triggers may never get this event, if a reference is able to pass through the trigger "between" frames.
  • While the only object type to receive this event under normal circumstances is activators, any actor, such as NPCs, can be made to receive the event by calling the EnterTrigger function on the reference directly. This can be used for scripting special activations independent of the normal Activate event, for example.

See AlsoEdit