0 votes

Hi..

I have a function that is run in _process() and I wanna time it so that after couple of seconds it stops running..
I made it so that if a certain bool is true the function runs, now I want the timer to be triggered when that bool is true also and want it to turn it false after couple of seconds, the problem is that my timer never time-out it get triggered every frame and I don't know how to deal with this

in Engine by (20 points)

1 Answer

0 votes

Sounds like you have to trigger the timer not when the certain bool ist true, but only when it's going from false to true. So you have to remember the old state in a variable.

by (62 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.