The more I am working with godot the more often I run into trouble with handling nodes and their paths. Usually I run into the node not found error for several tries until I find a way to get things done or change my approach to avoid the hassle.
I thought the find_node() method should be good to avoid dealing with paths too much, but this one did not even work once for me.
For example: I have a door scene instanced in my world scene with a static body attached to it. When the door is opened, I want to remove the static body.
My door scene is structured like this:
StandardDoor(Control) > SDoor (Area2D > StaticBody2D
The script is attached to SDoor, so when I write the following code:
var body = find_node("StaticBody2D")
self.remove(body)
I would expect this to find the static body and remove it. Instead I get a node not found error.
This is just one of many issues I have with referring to nodes. (And btw yes, I read the docs, but this does not seem to be enough to understand it. At least not for me...)
Is there a quick and easy way to refer to nodes? Or a really good tutorial to understand this? I would really appreciate some help.