I have a scene with this structure:
root has an export property with a setget method that affects child.
extends Node2D
export(Color) var colour = Color(1, 1, 1) setget _set_colour
func _set_colour(new_val):
colour = new_val
# Other relevant logic
...
get_node("child").set_modulate(new_val)
...
This scene is instanced in another main scene. When I load the main scene during gameplay though, this scene's _set_colour
is run but gets an error because get_node("child")
returns null.
Is it not possible to access the child node here?