trouble with func _process(delta)

Godot Version

`4

Question

i’m using func _process(delta) to decrease variable value over time. it did work, but it won’t stop when certain conditional is met.


as you can see when the variable verca is false it keep running

Hi,

The logs after process stop and false seem to show the value has been reset to 1. Is there some other code affecting those values?

Are you setting verca to true? (Nvm I read it wrong)

1 Like

here is the rest of my code

Thanks.

Your initial _process function looks fine and should be working as you want, but your variables are set somewhere else.
Add a print inside _on_power_time_timeout, I’m pretty sure this function is called and resets both value and verca, which would explain your problem.

1 Like

thanks! it does start over again.

i see the problem, i didn’t stop the timer…

thank you kind sir

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.