Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | haxpor | |
Old Version | Published before Godot 3 was released. |
I have the following node structure inside main
scene.
I’m trying to get SamplePlayer2D
node from play_fruit node. The latter is a child of CanvasLayer
according to doc would mean this node seems to be at the same level of Node2D
within this scene.
Inside play_fruit
node’s script, I have this code to get the node.
onready var test = get_node("/root/main/Node2D/SamplePlayer2D")
but I always get empty or null every time.
What’s the correct way to do this?