godot search node code example

Example: godot find_node()

find_node (String mask, bool recursive=true, bool owned=true )


Finds a descendant of this node whose name matches mask as in String.match (i.e. case-sensitive, but "*" matches zero or more characters and "?" matches any single character except ".").
Note: It does not match against the full path, just against individual node names.
If owned is true, this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don’t have an owner.

Tags:

Misc Example