x


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.

more ▼

asked Oct 13 '10 at 10:02 PM

Oninji gravatar image

Oninji
332 43 47 50

It should call it every time, so double check that you have everything set up correctly.

Oct 13 '10 at 10:48 PM Peter G

Can you tell more about this situation?

Feb 26 '11 at 02:10 PM Dinart Filho 1
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You have to add an Update function

more ▼

answered Apr 04 '11 at 12:30 AM

Someone gravatar image

Someone
-4 2

if there isn't an update function it wouldn't even be called once.

Nov 08 '11 at 09:27 PM cookies
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5081
x3460
x984
x478

asked: Oct 13 '10 at 10:02 PM

Seen: 1643 times

Last Updated: Nov 08 '11 at 09:27 PM