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
`4
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)
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.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.