Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask for collider groups #8887

Open
rigo128 opened this issue May 5, 2024 · 3 comments
Open

Mask for collider groups #8887

rigo128 opened this issue May 5, 2024 · 3 comments
Labels
editor Issues related to the Defold editor engine Issues related to the Defold engine feature request A suggestion for a new feature physics Issues related to physics (2D and/or 3D)

Comments

@rigo128
Copy link

rigo128 commented May 5, 2024

Problem: Setting up collision filtering for physics.
Imagine a game with three types of monsters: ground, flying, and ghosts. Ground monsters should collide with other ground monsters. Flying monsters should collide with other flying monsters. Ghosts should be able to move through any monsters. All monsters should collide with the hero's weapons. With the current system of setting collider groups, it's inconvenient to configure such behavior. It will be even more inconvenient to add a new type of monster.

Possible solution:
Allow setting a group as a mask. For example: "enemy, ghost" or "enemy, flying". In Box2d, there is already a possibility for such a setup: https://www.iforce2d.net/b2dtut/collision-filtering

@rigo128 rigo128 added the feature request A suggestion for a new feature label May 5, 2024
@rigo128
Copy link
Author

rigo128 commented May 5, 2024

Unfortunately, the mask group will break the current api with .other_group.

@Daniel-EST
Copy link
Contributor

I don't know if I understood correctly your suggestion. However, I am pretty sure, you can set multiple groups and masks by defining them using comma separation in the editor, just as you mentioned.

@rigo128
Copy link
Author

rigo128 commented May 5, 2024

you can set multiple groups

Unfortunately this doesn't work for groups.

@britzl britzl changed the title Mask for collider groups. Mask for collider groups May 6, 2024
@britzl britzl added physics Issues related to physics (2D and/or 3D) editor Issues related to the Defold editor engine Issues related to the Defold engine labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Issues related to the Defold editor engine Issues related to the Defold engine feature request A suggestion for a new feature physics Issues related to physics (2D and/or 3D)
Projects
None yet
Development

No branches or pull requests

3 participants