Jump to content

[LE] How to check if an Object is inside a trigger volume


WhiteWolf424242

Recommended Posts

Hello,

 

How can one check if an Object (accessible through a ReferenceAlias property) is inside a trigger volume?

I know that there is GetTriggerObjectCount(), but this only seems to return the number of objects inside a trigger, but can't check for specific objects.

 

Here's what I mean with the trigger script:

Scriptname WW42DBNazeemGutterScript extends ObjectReference  
 
ReferenceAlias Property AnActor  Auto

Event OnTriggerEnter(ObjectReference AkActivator)

    If(Game.GetPlayer() == AkActivator)
        If(  AnActor is inside the volume of this trigger.  )   <----- What goes here?
              ; ..... do my stuff
        Endif
    Endif

EndEvent

 

Thanks, any help would be appreciated :)

Link to comment
Share on other sites

You can always just track with OnTriggerEnter and OnTriggerLeave

 

Scriptname WW42DBNazeemGutterScript extends ObjectReference  

ReferenceAlias Property AnActor Auto
Bool ActorIsIn

Event OnTriggerEnter(ObjectReference akActionRef)
    If akActionRef == AnActor.GetActorRef()
        ActorIsIn = True 
    Endif
    
    If Game.GetPlayer() == akActionRef
        If ActorIsIn == True
              ; ..... do my stuff
        Endif
    Endif

EndEvent
  
Event OnTriggerLeave(ObjectReference akActionRef) 
    If akActionRef == AnActor.GetActorRef()
        ActorIsIn = False 
    Endif
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...