Godot Version
4.2.1
Question
My health and stamina bars are not visually changing when the value is updated.
“test” is bound to the ‘X’ button
min_value and max_value were left on the default values of 0 and 100
value was set in the editor to be 100
signal stamina_changed(old_value, new_value)
func _physics_process(delta):
if Input.is_action_just_pressed("test"):
change_stamina(-10);
func change_stamina(amount):
stamina_changed.emit(stamina, stamina+amount)
stamina += amount
Then, in the script on the stamina bar
func _on_player_stamina_changed(old_value, new_value):
value = new_value
print(str(old_value) + " " + str(new_value))
The print puts the correct old and new values in the console, but the textures on the progress bar don’t update. They do visually change if I change the value in the editor