14 lines
298 B
GDScript3
Raw Normal View History

2024-02-12 23:22:27 +00:00
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):
2024-02-13 19:38:17 +00:00
%Label.text = new_name