You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Group vs Group collisions fail if child objects have non-default masks or categories because the default collisionMask only matches the category "1".
#6764
The default mask that is set within the Body class and the Collision component only matches against collision categories that are equal to 1. If setCollisionCategory() or addCollidesWith() are used on sprites within a physics group this causes the objects to no longer collide when checked against another physics group, even if the mask values would work in direct Sprite vs Sprite collision checks.
Example Test Code
I've posted an example that reproduces the issue and includes a potential fix over on JSBin and included the core game code below as well.
I think the default collisionMask should be changed to 2147483647 so that it will match against any collisionCategory.
Also, there is added confusion when troubleshooting collision issues because the documentation for physics groups doesn't mention that they have a collision mask or collision category that can be set.
The text was updated successfully, but these errors were encountered:
It has been pushed to the master branch and will be part of the next release. If you have time do test it out. Feel free to let us know if you encounter any issues or need further assistance.
Version
Description
The default mask that is set within the
Body
class and theCollision
component only matches against collision categories that are equal to1
. IfsetCollisionCategory()
oraddCollidesWith()
are used on sprites within a physics group this causes the objects to no longer collide when checked against another physics group, even if the mask values would work in direct Sprite vs Sprite collision checks.Example Test Code
I've posted an example that reproduces the issue and includes a potential fix over on JSBin and included the core game code below as well.
Additional Information
I think the default
collisionMask
should be changed to2147483647
so that it will match against anycollisionCategory
.Also, there is added confusion when troubleshooting collision issues because the documentation for physics groups doesn't mention that they have a collision mask or collision category that can be set.
The text was updated successfully, but these errors were encountered: