Node not found

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

I get the ‘Node not found: guy’ when I run the scene. How do fix this?

:bust_in_silhouette: Reply From: Xrayez

When you operate from the root of your node, you don’t need to use get_node() method. So in your case it would be just get_pos(). If guy node were a child of another node, you’d use get_node('guy') then.

Oftentimes you’ll also need to initialize variables that require nodes to be ready before accessed (added to parent), so you’d write:

onready var guy = get_node('guy')