Hey, i've readed a lot of topics but none came to an solution. I am making a menu for the game and i need to have access to other nodes that are in other scenes.
The code i am making:
Player.gd
`
onready var globals := GlobalWorld.title_label
...
func _on_StartButton_pressed() -> void:
on_menu = false
$Head/Camera.current = true
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
globals.text = str("Hello")
pass`
this is the script i want to pick the nodes from the main scene, that have the following code:
World.gd
extends Spatial
onready var start_button: Button = $Control/Buttons/StartButton
onready var options_button: Button = $Control/Buttons/OptionsButton
onready var controls_button: Button = $Control/Buttons/ControlsButton
onready var quit_game_button: Button = $Control/Buttons/QuitGameButton
onready var title_label: RichTextLabel = $Control/Title/RichTextLabel
I'm using the Autoload if you may wonder, and i tried using the "getnode", simply what happens here is that globals.text simply returns a nullinstance (apparently).
details of the error: E 0:00:04.332 getnode: (Node not found: "Control/Buttons/StartButton" (relative to "/root/GlobalWorld").)
Method failed. Returning: nullptr
scene/main/node.cpp:1465 @ getnode()
World.gd:3 @ _ready()
im not really sure of whats happening, but keep in mind i want a node that is in another scene