0 votes

How can I select all the static bodies across the tree, that have specific collision layer deifined? Is there a simple solution or do I have to recursively traverse the whole tree and check for each node?

in Engine by (713 points)

Would it work to use groups?

I would still have to traverse the whole tree to add the nodes to the group, so the problem is still there.

How are you configuring the collision layers? Do certain entities/scenes belong to certain layers? Could you set the group for that entity type? Or are you changing the collision layers dynamically at runtime?

I'm making an addon, and I would like it to work "out of the box", so the user doesn't have to add all the nodes to a group for it to work.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.