Difference between revisions of "OnTriggerLeave - ObjectReference"

Jump to navigation Jump to search
m
imported>Cdcooley
 
imported>Goggle
 
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>
Anonymous user

Navigation menu