How i get a reference to a Node from a different scene?

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

so I got the code:

onready var Player = get_node("/root/World/Player")

I’m using it to check the position of my player. This is why I can’t use preload and I don’t know any other ways to get a node from a different scene.
The World node is pretty much my scene manager, where I stored all the scenes.

:bust_in_silhouette: Reply From: gmaps

You can use a singleton. Set up a globals script as described in this tutorial (make it autoload)

In your globals script define a variable player:

var player

In your Player scene call

Globals.set("player", self)

And then in any other scene where you want to check the player call