Here's the code:
var new_health = min(global.health + global.health_regeneration * delta, global.health_max)
if new_health != global.health:
global.health = new_health
emit_signal("player_stats_changed", self)
signal player_stats_changed
func _input(event):
if event.is_action_pressed("fatigue"):
global.health = global.health - 0.5
#on CollisionShape2D:
func _on_Player_player_stats_changed(var player):
$Bar.rect_size.y = 370 * player.global.health / player.global.health_max
Scale -1 just put the bar above, and repositionin it, it works fine. Cheers! :)