4everJang I need to switch visibility of 100s of nodes in my scene tree off at the start of a game. Tried to uncheck visibility on creation but that seems to be ignored by Godot when copy-pasting nodes. Is there an easy code to find all descendants of a certain type of my scene tree ? Or do I have to go through the hassle of writing recursive code ?
DaveTheCoder 4everJang Or do I have to go through the hassle of writing recursive code ? I don't see any relevant built-in method in the documentation, so I think you'll need to do that. But recursion is fun. 🙂
4everJang The crazy thing is that when copying the element in the scene tree, the copy action completely ignores the unchecked visible option. Which is why I need to fix this in startup code. But maybe I am overlooking something here...
DaveTheCoder When working on a project, I spend a lot of time toggling the visibility of nodes, especially when working on the UI. Placing nodes in groups may help. You can easily iterate through the members of a group. https://docs.godotengine.org/en/4.7/tutorials/scripting/groups.html You can even call a method, such as hide() or show(), on all members of a group with a single method call: https://docs.godotengine.org/en/4.7/classes/class_scenetree.html#class-scenetree-method-call-group