2024-02-13 00:22:27 +01:00

15 lines
299 B
GDScript

class_name HUDComponent
extends Sprite3D
@export var health: HealthComponent
func _ready():
texture = $SubViewport.get_texture()
update_name(owner.name)
if owner.has_signal("name_changed"):
owner.name_changed.connect(update_name)
func update_name(new_name: String):
%Label.text = new_name