Aller au contenu

Photo

How do I check if the PC is standing in a trigger? Not entering, standing.


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I have a stockade gate that I only want to be openable from one side. When the player clicks on the gate I was going to check to see if he or she was on the correct side before allowing them to open it.

To check the side I created a trigger, but I don't want the enter or exit event, I want to know if they are in the trigger area or not.

If there's not an event that tells me if they are in the trigger area, is there a better way to do this?

I'm using the stockade gate.

Thanks!

Modifié par PavelNovotny, 20 février 2010 - 10:27 .


#2
Challseus

Challseus
  • Members
  • 1 032 messages
Not sure about the trigger route, but you could check the X/Y coordinates of where they should be standing in the toolset. Then, in your script, use the function, GetPosition(object oTarget), to get a vector containing the current X/Y coordinates of the target, and make sure they are within the range.

Hope this helps.

#3
Nemorem

Nemorem
  • Members
  • 20 messages
You could just unlock the door when they enter the trigger, and (re-)lock it when they leave. Or, I assume, you could do the same thing by making it interactive/noninteractive when they enter/leave the trigger.

#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
IsInTrigger.

#5
Challseus

Challseus
  • Members
  • 1 032 messages

Craig Graff wrote...

IsInTrigger.


And that solves that, lol.