I have a problem with the editor tools!
My custom class has an export variable (
NodePath) with setter+getter functions, and I want to do something with the selected node (with the node itself, not with the path), after the selection!
Here is my code:
export(NodePath) var path setget setPath, getPath
path = newPath
if(path != null && path != ""):
print(str("path: ", path))
var node = get_node(path)
print(str("name of the node: ", node.get_name()))
print(">> WTF? <<")
print("path is empty")
And a screenshot:
When I choose a node (inspector), the
setPath() function called properly and everything works fine.
name of the node: Sprite
But when I save the project (CTRL+S), the
has_node() can not find the node (the
path variable is OK), and I don't understand why.
>> WTF? <<
What am I doing wrong?
(Godot Engine 2.1.3 stable win64)