I'm having health bar slowly decreasing over delta time.
TextureProgressBar
var current_bar_value = 100
const bar_speed = 5
func _process(delta):
current_bar_value -= bar_speed * delta
current_bar_value = clamp(current_bar_value,0, 100)
value = current_bar_value
func _on_button_pressed():
var add = value+20
var tween = get_tree().create_tween()
tween.tween_property(self, "value",add, 0.15).set_ease(Tween.EASE_IN_OUT)
After the button is pressed I want it to tween to new value +20 and continue on decreasing. The problem is it tweens there but quickly goes back to original decreasing value.
How to fix the code? Thank you.