- Home /
How to make OnTriggerEnter and OnTriggerExit functions more than once?
Hellow,
I have a code to switch a simply boolean on Enter and Exit, the thing it only work once.
Here is the two concerned function and the Boolean var.
var CanLaunch : boolean = false;
function OnTriggerEnter (ball) { CanLaunch = true;
}
function OnTriggerExit (ball) { CanLaunch = false;
}
On the first, enter it turn launch, and on the first exit it turn it false. But if the ball enter it again, it doesn't turn true again.
It should call it every time, so double check that you have everything set up correctly.
Answer by Someone.du · Apr 04, 2011 at 12:30 AM
You have to add an Update function
if there isn't an update function it wouldn't even be called once.
Your answer
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Setting Scroll View Width GUILayout 1 Answer
Inverse function of OnTriggerStay? 3 Answers
Static function and variables error 2 Answers