x


Loop troubles...

function TL () {
 if (linkedLight==enabled){
 InvokeRepeating("TL", 2, 0.3);
    TakeLifeInterval = 1;
    }
}

for some reason this does'nt want to work... it only removes 1 Lifeinterval every time you turn on the light... and not on a continuous loop overtime.

more ▼

asked Jul 11 '12 at 08:49 PM

saitoFOX gravatar image

saitoFOX
21 1 4 10

r u sure it is correct to start loop method inside method itself? add Debug.Log("hit") to monitor invoking.

Jul 27 '12 at 01:36 PM ScroodgeM

InvokeRepeating("TL", 2, 0.3);

function TL () {

if (linkedLight==enabled){

TakeLifeInterval = 1;

}

}

as @ScroodgeM mentioned, you shouldn't be calling the method from itself

Jul 27 '12 at 01:42 PM Seth Bergman
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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:

x426
x294

asked: Jul 11 '12 at 08:49 PM

Seen: 221 times

Last Updated: Jul 27 '12 at 01:42 PM