Difference between revisions of "OnTrigger - ObjectReference"
Jump to navigation
Jump to search
imported>Heecf |
(Add detail about how often the event is sent) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Scripting]] | |||
[[Category:Papyrus]] | |||
[[Category:Events]] | |||
'''Member of:''' [[ObjectReference Script]] | |||
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). | |||
== Syntax == | |||
<source lang="papyrus"> | |||
Event OnTrigger(ObjectReference akActionRef) | |||
</source> | |||
== Parameters == | |||
*akActionRef: The [[ObjectReference Script (Papyrus)|ObjectReference]] that triggered this reference. | |||
== Examples == | |||
<source lang="papyrus"> | |||
Event OnTrigger(ObjectReference akActionRef) | |||
Debug.Trace(akActionRef + " just hit us!") | |||
EndEvent | |||
</source> | |||
== 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. | |||
== See Also == | |||
*[[ObjectReference Script]] | |||
*[[OnTriggerEnter - ObjectReference]] | |||
*[[OnTriggerLeave - ObjectReference]] | |||
Latest revision as of 15:18, 20 March 2022
Member of: ObjectReference Script
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).
Syntax[edit | edit source]
Event OnTrigger(ObjectReference akActionRef)
Parameters[edit | edit source]
- akActionRef: The ObjectReference that triggered this reference.
Examples[edit | edit source]
Event OnTrigger(ObjectReference akActionRef)
Debug.Trace(akActionRef + " just hit us!")
EndEvent
Notes[edit | edit source]
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.