Godot Version
Godot 4.4 - mono
Question
` I tried following the principle of the Godot tutorial to implement an UI, but i keep getting null instances, even though my paths are correct.
Here is my node tree:
and my hud node tree:
here is the code in hude.gd (attached to the hud canvas layer):
extends CanvasLayer
@onready var dealer_charges_counter: Label = $DealerChargesCounter
@onready var player_charges_counter: Label = $PlayerChargesCounter
@onready var player_label: Label = $PlayerLabel
@onready var dealer_label: Label = $DealerLabel
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
SignalManager.update_lives.connect(update_lives)
# Called every frame. 'delta' is the elapsed time sisnce the previous frame.
func _process(_delta: float) -> void:
pass
func update_lives():
print("Player lives: ", Lives.player_lives)
print("Dealer lives: ", Lives.dealer_lives)
player_label.hide()
dealer_label.hide()
player_charges_counter.text = str(Lives.player_lives)
dealer_charges_counter.text = str(Lives.dealer_lives)
and here is the error:
Here are my globals: