godot get scene root
To get the root node of a scene in GDScript using the Godot game engine, you can use the get_tree().get_root()
method. Here's an example:
var root_node = get_tree().get_root()
This code retrieves the root node of the currently active scene and assigns it to the variable root_node
. You can then use this variable to access and manipulate the root node as needed in your script.