Problems with health bar
Hello, i apologize if this isn't a proper question, but this is certainly getting on my nerves.
I have the following node setup
-Root ---SingletonA ---Main -------Level -------HUD -----------Health(ControlNode) -----------HealthBar(Textureprogress)
And in my player script i have this signal:
self.connect("healthbar", ROUTETOHEALTH(CONTROLNODE), "_on_health_updated")
I also have this on my player script when the "hurt" routine is fired:
emit_signal("healthbar", self.hitpoints) ##self.hitpoints is updated before this part##
On the Health(ControlNode) script i have this:
extends Control onready var HealthBar = $HealthBar func _on_health_updated(newhealth): HealthBar.set_value(newhealth) print(HealthBar.value)
According to the printed message, the health value is updated accordingly, yet, graphically, the bar never shrinks or moves, so i am wondering if i'm missing something or if i'm doing a completely wrong approach.