BGE: Adding support for Bullet’s collision masks. 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.
They also mention that it’s been heavily tested so any remaining issues that blocked its inclusion in 2.64 is likely resolved. You should now be able to find this new feature in any build after Rev. 51769 as well as expect to see it in 2.65.
I know that it’s been a long wait for this, but now you can be excited that you can finally make use of it in your games.
It means you can have different sets of objects that collide with some of the other sets, but not others.
So you have objects A, B, C, and D.
-Objects A and B are in collision group 1
-Objects C and D are in collision group 2
-You can set it so object A can collide with B, but won’t collide with C and D (it will just go through them as if it was a ghost object).
As an example, you can use it to create invisible barriers for a select group of objects, you can also use it for trick platforms that the player falls through but the enemies don’t, and that is just for starters.
Yeah, this is really super useful to have. Very nice. Gonna go test it out really quickly.
EDIT: Just tested it out. Seems to work really well.
EDIT 2: As a side-note, it appears the new group functionality has been renamed - objects don’t have a group property, but rather group_parent and group_children properties.
This kicks so much butt. I’m coming from UDK and there has been so many times where the collisions have frustrated me because of the lack of this kind of functionality.
However, I think I may have found a bug. I have some objects who are in group 2 but are only masked to collide with group 1. If the game starts without any of the objects intersecting, it works fine: they float straight through one another. But, if the game starts with them intersecting one another, they pop away like normal, before ignoring collisions once more.
That does indeed seem to be the case. It looks like if you want to have objects that don’t collide with one another on starting the engine, you’ll need to position them safely away and then move them after the game begins. I think you should post a bug report on the game engine bug tracker. That helps to give bugs a centralized place for sorting.
Incidentally, the bug I posted earlier isn’t present when you use dupligroups. When you have several dupligroup cubes, they don’t bounce apart on startup. See here: groupsOfGroups.blend (506 KB)
Out of curiosity, does this extend to raycasts as well? For example, if Object A and B can’t collide with one another, can object A detect object B using the raycast sensor or A.rayCast( … )?
very cool!!
i tryed it and seem fulll of cool improvement .(i have to test a bit more but seem all right)
finally also the group stuff!
i just not like much the underscore
group_parent
group_children
is decisely a exception as sintax .(while i like the choose of the word)
the collision improvement is very useful ,and pretty easy to use
To note, this was not Moerdn’s decision, this change was made by Campbell on the count of making it more clear what these attributes are used for. (he tends to be specific on these sort of things).