14 lines
298 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