Hi,
I'm using a tween to animate a progress bar's value, so it has an smooth and continuous decreasing movement. The point is that I want to refill the bar again (by setting its value to its maximum value, which is variable depending on the level's difficulty) once the player has finished the current level, and without reloading the current scene, but the line that should be doing that is ignored, without throwing any error or warning. I'm using this code:
func setup_timebar():
if smoother:
smoother.kill()
$TBContainer/TimeBar.value = $TBContainer/TimeBar.max_value
print("Reset to " + str($TBContainer/TimeBar.max_value))
smoother = get_tree().create_tween()
smoother.tween_property($TBContainer/TimeBar, "value", 0, $TBContainer/TimeBar.max_value)
smoother.tween_callback(_time_over)
That function is called whenever player completes the current level and passes to the next one. As you can see I'm using the kill() function and even checking that the reset is being done, it outputs "Reset to 15", but the bar keeps decreasing from where it stayed. I tried using stop() function as well (afaik, according to the documentation stop() function should reset the value it was animating by its own), alone or alongside with kill() but that line keeps being ignored. How can I solve that?
Thanks in advanced.