- Home /
Question by
Jordan Miller 2 · Mar 24, 2011 at 07:34 AM ·
trigger
OnTriggerStay called once option?
so I am using a trigger collider. I don't wanna know every frame if the other collider is in the Trigger, I just want to call it once like in a for statement. like this:
var allothers = all colliders inside this trigger;
for (var other : Collider in allothers)
of course thats not real but is there a way to do that? I'm trying to stay away from Ontriggerstay because I don't need to know all the colliders in the trigger each frame - I just need to check once or twice.
Comment
Best Answer
Answer by Eric5h5 · Mar 24, 2011 at 07:39 AM
That's what OnTriggerEnter is for. Use a List and add to it when something enters the trigger, then remove it in OnTriggerExit.
Your answer
Follow this Question
Related Questions
Can't click gameobject when over another trigger? 1 Answer
Are Triggers not based upon normals? 3 Answers
Sound Trigger 2 Answers
Trigger Effect Error 1 Answer
Low gravity on trigger. 2 Answers