How do I reset my timer?

I have this code here:


Basically, it’s supposed to change your speed by 1 every 2 seconds. However, when I run the preview, the speed doesn’t stop growing, even though it’s only supposed to change every 2 seconds. I don’t think it’s resetting the timer for some reason. Help?

You are only resetting the timer “SpeedChange”, you are never resetting the timer “InfiniteAction” after the start of the scene.

Therefore, you’re constantly adding a permanent force, every frame, after 0.1 seconds have passed on the “InfiniteActivation” timer.

If you only want to add the permanent force once, you need to add a “trigger once” for that 3rd event.

ah, thank you! The code works now.

1 Like