I want to ask how I could get the root node from a script attached to a node. This sounds idiotic but the script attached to it will be an instance of a new scene. I’m a beginner-intermediate and I’d love to hear your help!
If script extends NOT from Node extended class, you need to make your own singleton that extends Node and then address root from it
DataGlobal.get_tree().root
I realized that the mistake I made was that I forgot to add @onready! I hope no one makes this mistake again!
I want to state that @ratrogue was indeed correct and it is an alternative way to get the root node! I suggest writing @onready var A_Variable = get_tree().root.get_node(“RootNameNode”).get_node("TheTargetNode")