Node not found: Control/PopUpMenu/Label

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

Ok sooooo… i have this problem where my nodes are not found but they clearly exist, so what do i do?

My Script Right here:

extends Control
const SAVE_DIR = “user://”
onready var console_label = $Control/PopUp/Label
var save_path = SAVE_DIR + “save.dat”
func _on_Save_pressed():
var data = {
“name” : “Player”,
“Speed” : 200,
“LevelProgress” : “”,
“Levels” : “”,
“Stars” : “”,
}

var dir = Directory.new()
if !dir.dir_exists(SAVE_DIR):
	dir.make_dir_recursive(SAVE_DIR)
	
var file = File.new()
var error = file.open_encrypted_with_pass(save_path, File.WRITE, "wl8x2u9x49u4tfuf88efuf93r883rhzh")
if error == OK:
	file.store_var(data)
	file.close()

console_write("data saved")

func _on_Load_pressed():
var file = File.new()
if file.file_exists(save_path):
var error = file.open_encrypted_with_pass(save_path, File.WRITE, “wl8x2u9x49u4tfuf88efuf93r883rhzh”)
if error == OK:
var player_data = file.get_var()
file.close()
console_write(“data loaded”)
func console_write(value):
console_label.text += str(value) + “\n”
func _on_Register_pressed():
get_tree().change_scene(“res://Register.tscn”)
func _on_Login_pressed():
get_tree().change_scene(“res://Login.tscn”)

How does your scene tree look?
Show where the script is attached too, this might give a better clue at where the problem is.

Bubu | 2021-04-09 17:27

hmm… okay ill check thank you

FurizAlex | 2021-04-10 07:29

Please show us your scene tree so that we can help you identify the problem

MikeSundaysGameDev | 2021-04-10 09:37

:bust_in_silhouette: Reply From: beaverusiv

If the Control is the root node for the scene $PopUp/Label might work.

Either way, the IDE itself will help auto-complete node paths so play around in the editor and make sure you pick one of the options it gives you.

Just type onready var console_label = $ and after the “$” it should pop up with suggestions