I have below unique case.
var current_weapon: Node3D = null:
set(value):
current_weapon = value
if current_weapon != null:
display_weapon_name(current_weapon.name)
func _ready() -> void:
# Set the machete as the current weapon
current_weapon = $Weapons/Machete
current_weapon.show()
func display_weapon_name(display_name: StringName) -> void:
print_debug(display_name)
weaponName.text = "Weapon: " + display_name
[Issue]: above code runs fine and but displays label only when run from _ready. if I run this on pressing keys, it runs even display print message, but does not display anything in Label. Infact it clears Label text.