Mod:Creation Kit/OnTriggerEnter - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script (Papyrus)

Event called when the object reference is a trigger volume and has been entered.

Syntax
Event OnTriggerEnter(ObjectReference akActionRef)

Parameters

 * akActionRef: The ObjectReference that entered the volume.

Examples
Event OnTriggerEnter(ObjectReference akActionRef) Debug.Trace(akActionRef + " just entered us!") EndEvent Event OnTriggerEnter(ObjectReference akTriggerRef) if GetTriggerObjectCount == 1 if akTriggerRef == Game.GetPlayer ;	debug.notification("Entered Trigger") GetLinkedRef.Activate(Game.GetPlayer) endif endif EndEvent
 * Check how many objects are inside the trigger so that the events run in proper sequence.

Event OnTriggerLeave(ObjectReference akTriggerRef) if GetTriggerObjectCount == 0 if akTriggerRef == Game.GetPlayer ;	debug.notification("Leaving Trigger") GetLinkedRef.Activate(Game.GetPlayer) endif endif EndEvent