Godot Version
4.7.1
Question
I’m following a tutorial for the engine. The tutorial had me create a scene—let’s call it item.tscn—that has a configurable variable, for the length of a line that is a child node of item.tscn. The line’s points are set in the inspector to two points, each with the position (0, 0). To see the results of this configuration in real time, I was told to use set(). When the variable’s value is changed, the code should lengthen/shorten the line.
Now, this works fine in the map scene.
However, in item.tscn itself, the line’s length does not update! set() isn’t even called at all! Why isn’t set() called in item.tscn, yet is called in the map scene?
@tool
...
@export_range(12, 400) var length := 32 :
set(new_length):
print("Blarg")
length = new_length
...
# In item.tscn: prints "Set length"
# In map scene: prints "Blarg\nSet length"
P.S. Setting the second point’s x value manually works, meaning the line didn’t somehow cease to exist.