Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | skullkid |
Hi guys,
I recently converted from Unity to Godot, so forgive me if this is a stupid question.
I’ve been trying to access two nodes from a script attached to an empty root Node using get_node():
extends Label
var rgb = 0
func _process(delta):
rgb += 0.02
get_node("Label").set_modulate(Color(rgb,rgb,rgb,1))
if get_node("Label").get_modulate == Color(1,1,1,1):
get_node("Banner").visible = true
Whenever I try to run this script, I get an error telling me these two child nodes can’t be found.
Here’s a link to the scene tree as it appears the editor (the script is attached to Root):
Scene tree
Do you have any suggestions as to why this might be happening?
Thanks in advance
Edit: So I redid the scene tree and all of its nodes and the get_node() method spontaneously started working again. Weird.