get_node not working even though the path is right

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

I have a script in a kinematic body 2d that uses onready var raycast = get_node(“DownCast”) to find a raycast, but even though the path is right, it still responds with attempt to call function get_collider in base null instance on a null instance. If someone could help i would be very happy.

  • What is the organization of your scene tree related to the nodes in question?
  • Which node is the above code attached to?
  • Post the offending code

jgodfrey | 2023-01-28 15:54

:bust_in_silhouette: Reply From: moredear

Hi, can you post the scene structure?
Nodes load from bottom to top while getting ready, if the raycast is on top of the kinematic body in the scene tree, then it has not been loaded while the kinematic body is ready and searching for it, so the kinematic body can’t find the raycast, because it’s not ready yet.