get_node("../../... any more safe and stable way to reference a node in another scene?

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

It’s working of course, but if you change the node hirarchy it will mess up. Now this is of course easy to debug, but I just wondered if there’s a better way. Some people mentioned signal connecting through inspector, but obviously this is only safer for nodes inside one scene. Any ideas?

RID — Godot Engine (latest) documentation in English

you can find the node then store the rid.

Why does Godot use Servers and RIDs?

I think the rid stays the same.

hungrymonkey | 2018-04-04 21:05

:bust_in_silhouette: Reply From: GunPoint

You can use signals, groups, find_node(), referencing through the inspector (export variables), the $ sign (which is the same with get node)