Godot Version
Godot 4.2.1
Question
I want to update the Label whenever my Variables change, but I dont know how to do that.
This is my Script:
extends CanvasLayer
var speed = PlayerStats.speed
var damage = PlayerStats.damage
var current_jumps = PlayerStats.current_jumps
var jump_count = PlayerStats.jump_count
var jump_velocity = PlayerStats.jump_velocity
var double_jump_velocity = PlayerStats.double_jump_velocity
var current_health = PlayerStats.current_health
var max_health = PlayerStats.max_health
var gravity_multiplier = PlayerStats.gravity_multiplier
func _process(delta):
show_hp()
show_jumps()
func show_hp():
$Health/HP.text = str(current_health, "/", max_health, " HP")
func show_jumps():
$Jumps/Jumps.text = str(current_jumps, "/", jump_count)