Difference between revisions of "OnTriggerEnter - ObjectReference"

→‎Examples: Added example to coincide with the note about GetTriggerObjectCount()
imported>Cdcooley
 
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>
Anonymous user