Closed
Description
Godot version
System information
ArchLinux x11
Issue description
Accessing a scene unique node like this:
class_name Class extends Node
static func get_label() -> Label:
return %label
and then accessing that class later:
func _ready() -> void:
Main.get_label().text = "hello world"
causes a strange error when in the editor, and a normal error when run directly.
ERROR: Node not found: "%label" (relative to "/root/main").
at: get_node (scene/main/node.cpp:1364)
Instead of returning null.
As opposed to when using get_node
:
SCRIPT ERROR: Cannot call method 'get_node' on a null value.
at: get_label (res://main.gd:5)
SCRIPT ERROR: Invalid set index 'text' (on base: 'Nil') with value of type 'String'.
at: _ready (res://control.gd:4)
Steps to reproduce
Run mrp or follow outlined steps
Activity