unable to get coordination from panel

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By D.Q.Li

the code is short

onready var card1 = get_node("coordination/Panel1")
var debug = card1.rect_position

and the error message is:Invalid get index ‘rect_position’ (on base: ‘Nil’).
I tried both position and rect_position and none worked. Though the two lines of code came from a bigger section attemps to get coordination from other types of nodes works perfectly. Please help me out.

:bust_in_silhouette: Reply From: Dri

on base: ‘Nil’

means that your variable card1 is empty. It’s commonly referred to as a NullpointerException. Check if the node can be found by following exactly the Path you’ve provided. Try moving the node directly as a child and use $Panel1 to make sure that this is the error.