0 votes

The script path is located in root/Game/script location

The node path I want to get is located in root/Menu/menu2/Labal

(Using placeholder names for example)

How can I get the label I tried using get_node but it keeps printing nulls
here is a picture to make it easier to understand: https://pasteall.org/pic/6556d8f4dba5472ebd4750449e90eb01

user info is the script and team name at the bottom is the label I want to access

Godot version 3.2.3
in Engine by (156 points)

2 Answers

+1 vote
Best answer

In order to access a parent node with get_node(), you must use "..". So try get_node("../../Menu/DebugTeam/TeamName"). Or you can use an absolute path, which I think should be get_node("/root/Menu/DebugTeam/TeamName").

by (7,769 points)
selected by
0 votes

You seem to be trying to get different scenes to communicate.

You can instance the Menu scene, send a signal, or use the '../..' notation to the path.

by (327 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.