NoahTTR
1
Hey, I was wondering on how to make a timer for my game.
I wanted to make it where when you click a button, smoke will appear only for a certain amount of time then stop.
t = Timer(2.00, self.smoke.hide)
t.start()
I tried using this and it works but when I try to click the buttons it says I can only start the timer once.
Is there any way I could make it where I can reset the timer or something like that so I could start it again?
Thank you, Noah
Stijn
2
Hi,
I would use intervals for this. https://www.panda3d.org/manual/index.php/Intervals
t = Sequence(Func(self.smoke.show),Wait(2.0),Func(self.smoke.hide))
t.start()
If you want to restart the interval, finish it before you start it again using t.finish()
NoahTTR
3
Yes, thank you very much. I don’t know why I didn’t just use an interval sequence instead of a timer lol.