Difference between revisions of "OnTriggerEnter - ObjectReference"
Jump to navigation
Jump to search
OnTriggerEnter - ObjectReference (edit)
Revision as of 07:53, 26 August 2016
, 07:53, 26 August 2016→Examples: Added example to coincide with the note about GetTriggerObjectCount()
imported>Cdcooley (→Notes) |
imported>Goggle (→Examples: Added example to coincide with the note about GetTriggerObjectCount()) |
||
Line 18: | Line 18: | ||
Event OnTriggerEnter(ObjectReference akActionRef) | Event OnTriggerEnter(ObjectReference akActionRef) | ||
Debug.Trace(akActionRef + " just entered us!") | Debug.Trace(akActionRef + " just entered us!") | ||
EndEvent | |||
</source> | |||
<br> | |||
<source lang="papyrus"> | |||
Event OnTriggerEnter(ObjectReference akTriggerRef) | |||
if GetTriggerObjectCount() == 1 | |||
if akTriggerRef == Game.GetPlayer() | |||
; debug.notification("Entered Trigger") | |||
GetLinkedRef().Activate(Game.GetPlayer()) | |||
endif | |||
endif | |||
EndEvent | |||
Event OnTriggerLeave(ObjectReference akTriggerRef) | |||
if GetTriggerObjectCount() == 0 | |||
if akTriggerRef == Game.GetPlayer() | |||
; debug.notification("Leaving Trigger") | |||
GetLinkedRef().Activate(Game.GetPlayer()) | |||
endif | |||
endif | |||
EndEvent | EndEvent | ||
</source> | </source> |