Unfortunately, as far as I know there is no equivalent built in to Godot. You can instead do something like this though (just an example):
func disable_children_nodes():
for child in get_children():
# Disable the node as much as possible by telling the
# the node not to call _process and _physics_process.
child.set_process(false);
child.set_physics_process(false);
# Check if the node has a function called “on_disable”
if (child.has_method(“on_disable”):
child.on_disable();
func enable_children_nodes():
for child in get_children():
# Reset what we disabled in disable_children_nodes
child.set_process(true);
child.set_physics_process(true);
# Check if the node has a function called “on_enable”
if (child.has_method(“on_enable”):
child.on_enable();
The biggest part in the code above is using the has_method function. The has_method function returns true if the node in question has a function with the same name as the string passed in.
For example, in the code above, the on_disable and on_enable functions will be called on any of the children nodes only if the script attached to it has a function with one of those names.
Also, you may want to move set_process and set_physics_process into the on_enable/on_disable functions just so you can only specifically enable/disable parts that need it.
Hopefully this helps :smile: