How on earth do collision groups work?

Hi,

I usually don’t use the physics engine much in games…

How exactly do collision groups work? I have set one object to group 1, mask 1, and another to group 2, mask 2. They still collide? Surely they shouldn’t? It works fine with two rigid bodies, but not a rigid and a solid. What am I doing wrong?

Thanks

Honestly the collision groups seem to work by voodo…

I have had them work, but I just turned layers on and off until it did, it did not make much sense.

According to the release notes

Collision mask support added: each object now has a collision mask and a collision group. Object A and object B collide if object A’s groups is in object B’s mask and object B’s group is in object A’s mask. In other words, the group defines what the object is (collision wise) and the group defines what the object can collide with. (r51769)

Seems a bit like it, hey.

Ah so the mask is inclusive rather than exclusive. That makes sense. I don’t know what was happening with the earlier thing I was doing. It must have been a bug, since I set up a new .blend with the exact same settings and it worked.

Fixed.

Note that the groups don’t apply on the first game frame for whatever reason; if objects are colliding in the first frame (even in separate groups with masks that don’t take those groups into account), they’ll basically be “pushed into the same group”, in a way. Doesn’t really make sense, I know. I believe it’s a long-standing bug.

Unfortunately, it’s not really a new BGE feature these days if it doesn’t come with its own bugs, the source is enough of a mess that it’s simply a difficult task to add something new that’s bug-free.

It’s why developers have stopped working on the code and longtime users are moving to other engines, I know Godot at least has collision layers and even has functions to give new layer assignments to objects (something which was planned for the BGE, but is now shelved until further notice).