Background for Skyrim SE
Member of the ObjectReference script
eventOnTrigger(ObjectReferenceakActionRef)

Description

Wiki Description

Event called when the object reference is a trigger and has been triggered. This event will be sent every so often while a reference stays inside the trigger box (approximately two times a second).

Documentation Comment

Event received when a this trigger is tripped


Caveats

CK Wiki - Notes

  • This event is sent repeatedly, so care should be taken not to tie up the script system unnecessarily with a long complicated handler. Try using the trigger enter and leave events instead.
  • The rate at which this event is sent is controlled by the [Havok]fTriggerEventDelayMS INI setting, which defaults to 500.0. On Windows, the game measures how many milliseconds have passed since a trigger last sent a batch of OnTrigger events using the QueryPerformanceCounter Win32 API.
  • OnTrigger events are sent all at once for all refs (whose collision layers match that of the trigger) within the trigger's volume.

Parameters

  1. ObjectReferenceakActionRef

    CK Wiki Description

    The ObjectReference that triggered this reference.


Examples

Event OnTrigger(ObjectReference akActionRef)
  Debug.Trace(akActionRef + " just hit us!")
EndEvent

Auto-Generated Example

Scriptname MyCoolScript extends ObjectReference

event OnTrigger(ObjectReference akActionRef)
    Debug.trace("Event received - OnTrigger: akActionRef = " + akActionRef)
endEvent

Related Pages


Additional References

View this event’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.