Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | C3P0h_no |
I’m trying out scriptable objects in Godot and I ran into an issue with an export variable that is of type NodePath.
My object
export (NodePath) var rayCast
export (NodePath) var animatedSprite
onready var ray = $rayCast
onready var anim = $animatedSprite
In the editor
I create my player scene with my scriptable object as the root node:
I select my nodes:
Next I instance my player scene in the MainScene
But when I press run:
I get the error :
E 0:00:00.498 get_node: Node not found: animatedSprite.
<C++ Error> Condition “!node” is true. Returned: __null
<C++ Source> scene/main/node.cpp:1381 @ get_node()
Character2D.gd:22 @ _ready()
Do I get this error because my animatedSprite NodePath no longer finds the node?
please show your _ready
method
whiteshampoo | 2021-03-28 17:18