Schedule function not working
by Nicolas Goulet · in iTorque 2D · 09/10/2010 (7:08 pm) · 6 replies
Hi,
I'm trying to use the schedule function to load something after 20 seconds and it will just load it instantly instead. Here's my simple code.
schedule(200000, 0, LoadLevel(%level));
It just loads it instantly. I've tried lots of different settings but it seems the schedule function just doesn't care about the delay you provide to it. Does anybody know what the problem might be?
I'm trying to use the schedule function to load something after 20 seconds and it will just load it instantly instead. Here's my simple code.
schedule(200000, 0, LoadLevel(%level));
It just loads it instantly. I've tried lots of different settings but it seems the schedule function just doesn't care about the delay you provide to it. Does anybody know what the problem might be?
#2
09/13/2010 (8:16 am)
It works! thanks
#3
It's in the behavior I use:
%this.owner.schedule(3000,0, %this.owner.setLinearVelocityX(-100));
I don't want to write any special function for linear velocity to execute such a simple code.
Any suggestion, please.
04/18/2012 (1:12 pm)
Hm, this one doesn't work either. Or better to say it is executed without any delay.It's in the behavior I use:
%this.owner.schedule(3000,0, %this.owner.setLinearVelocityX(-100));
I don't want to write any special function for linear velocity to execute such a simple code.
Any suggestion, please.
#4
04/18/2012 (2:02 pm)
@Alex, you don't need the "0" when the schedule is associated with an object.%this.owner.schedule(3000, setLinearVelocityX, -100);
#5
I also read some topic that says that the %this shouldn't be used with schedule.
I'm at work now. Once I'm back home I'll take another try (maybe I should make the total cleaning of my project).
04/19/2012 (12:21 am)
@Scott, Thanx a lot! First I thought that it might be because I used bahavior but then I put it all in playerClass.cs and in main.cs. I also read some topic that says that the %this shouldn't be used with schedule.
I'm at work now. Once I'm back home I'll take another try (maybe I should make the total cleaning of my project).
#6
04/19/2012 (10:21 am)
@Scott, thanx again. Everything works fine.
Associate Craig Fortune
schedule(20000, 0, LoadLevel, %level);