when i setCollisionGroup and setCollideWithGroups, the bricks are fall through the floor…
i dont understand what happend, and sorry for my english.
March 15, 2020, 6:44pm
What collision group does the floor belong to?
March 15, 2020, 6:48pm
Which would be
COLLISION_GROUP_01. So the floor and the bricks don’t collide. So there’s no contact force and nothing to keep the bricks from falling through the floor.
here is my expectation, i want my bullet shoot the brick, and doesnt shoot the floor, so i setCollisionGroup on bullet and brick, then implementsPhysicsCollisionGroupListener to fiter event, but now it doesnt work, what should i do? thanks.
March 15, 2020, 6:58pm
If the bullet misses the bricks, do you want it to pass through the floor?
no, just like normal. but shoot the brick, i will add some effects on the collision point, so i need differentiate them.
March 15, 2020, 7:19pm
So use the default collision group for all objects. When a collision is detected, determine what objects were involved and handle accordingly.
but the collision() has too much event, so i want use collide() to filter, so i have this question…
Is there any better way?
March 15, 2020, 7:35pm
I believe my suggestion is the best way.
Thanks, i just worried about whether too much conditional judgment will affect efficiency.
After all, I only care about a few collisions.
March 16, 2020, 7:12pm
Collision groups aren’t very efficient. And they have important side effects, as you’ve seen.