Difference between revisions of "OnTriggerLeave - ObjectReference"
Jump to navigation
Jump to search
m
OnTriggerLeave - ObjectReference (edit)
Revision as of 07:58, 26 August 2016
, 07:58, 26 August 2016→Examples
imported>Cdcooley |
imported>Goggle m (→Examples) |
||
Line 18: | Line 18: | ||
Event OnTriggerLeave(ObjectReference akActionRef) | Event OnTriggerLeave(ObjectReference akActionRef) | ||
Debug.Trace(akActionRef + " just left us!") | Debug.Trace(akActionRef + " just left us!") | ||
EndEvent | |||
</source> | |||
<br> | |||
<source lang="papyrus"> | |||
; Check how many objects are inside the trigger so that the events run in proper sequence. | |||
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> |