open-strike-2/scenes/maps/hud.gd

18 lines
517 B
GDScript

extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@onready var health_indicator: Label = $HealthIndicator
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var root := get_tree().get_root()
var id := multiplayer.get_unique_id()
var player_data = GameServerManager.get_player_health.rpc_id(1, id)
health_indicator.text = str(player_data["health"])
pass