Collision Layers trouble

Hi everybody :eyebrowlift:

I have this problem that these two cubes which souldn’t have collisions together (cause they are set up so in the collision mask layers)… have collisions. :mad:

cube 1 (rigid body)


cube 2 (rigid body)


The more strange is that they have collisions only at the launch of the BGE (one cube is jumping out of the second cube) as I press “P”, but not anymore after, by falling and react as they should do colliding together ignoring collisions. :confused:

video

You can have a look to the Blend file

Why don’t they react so (not having collisions together) from the very begining by pressinf “P” ?

Thanks for your help

This happens because the cubes are intersecting on the first frame of the game engine. You can get around this by either separating them or adding one or both of the objects from an inactive layer after the game starts.

Thank you mobious… i was hoping it would be possible to let them on the same layer… Anyway I’ll try.

Otherwise is it possible to set and unset an object as ghost during the BGE is running ? (I didn’t find any actuator logic bricks that would let it possible; but maybe a little script)

Unfortunately there isn’t. The easiest way to accomplish this would probably be to just have a copy of the object that has ghost enabled and just swap it out whenever you need to enable ghost.

Hey Mobious, thank you for this advice

because the cubes are intersecting on the first frame of the game engine

So I 've used the sensor logic brick “Delay” to suspend dynamics during the first BGE frame (to freez the intersecting cubes position) and then restore them (dynamics) after the first frame. Now it works.

THANKS