![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | The_Black_Chess_King |
I am currently trying to automate an update to my child label to be runned in the editor, however it always returns to it’s default value after I click on another node, I’ma show as it’s easier than explaining:
The node structure of the scene is
World node:
Node2D -> Box
Label
Node2D -> Box1
Label
BOX, Node2D code:
tool
extends Node2D
export(String) var ItemID = "NOONE" setget UpdateMyLabel
func _ready():
pass
func UpdateMyLabel(newName):
if Engine.editor_hint:
$Label.set_text(newName)
I duplicate the Box a fewer times, select the first and type in the exported var, it works, the label get’s renamed, however when I select another box, the ItemID on the previous node get’s reset to “NOONE”, but the label doesn’t update, and if I print it really changed to the default value: NOONE. Why is that?
There’s not anything more running in the background, I recreated this with a clean scene.