HOW TO - Avoid Players Collition

Hi dear members of the forum. I use Blender long time ago, but I’m totally new with the Game Engine.

I’m trying to make a game. The aesthetic part is done, but I’m having troubles with the physics, so need your help.

I have many objects like walls, boxes, bombs, etc. (all of them with Static Physic type) and the players meshes (with Dynamic Physic type). My problem is, I want character to collide with objects, LESS between them (like ghosts only between them).

  • So my question is how I can do this with Logic Bricks? (I’m new at this, so 0% idea how to use Python).
  • Unless there’s ANY OPTION than to use Pyhton, how would be the Script idea to make mesh P1 collide with all except P2, P3, P4? (P1, P2, P3 and P4 are the name of player meshes).

Thanks a lot to all for your valuable help.

I’m not sure, but I think Collision Groups (and Masks) is what you are looking for. Have a look at the blend and let me know if I misunderstood.

Attachments

Collsion_group_and_mask_example.blend (86.4 KB)

Raco, nice example. But in the file objects only can collide between ONLY the same group. I need and object (example cube.000 can collide with all, except cube.001… and same time, cube.001 can collide with all, except cube.00. I’m sorry for being new at this, I guess the solution can be there (collision groups/layers) but can’t see clear. Any idea? Thanks for your help.

Raco’s explanation is fine and should work for your issue. Just set the two cubes in separate collision groups, and set everything else in a third group. Then, set both cubes to have that third collision group as a mask.

As a quick breakdown, a collision mask defines what groups an object can collide with. So, if you want Cube A to collide with Cube B, make sure Cube B is in the same collision group that Cube A has set as a mask. By default, objects collide with every collision group (all collision masks are set to be used).

Thanks, Solarlune. Made another example.

Attachments

Collsion_group_and_mask_example_2.blend (87 KB)

Thanks a lot for both, Raco & SolarLune. With the example I could made it work perfectly. SOLVED