Rigidbodycontrols with mass > 0 going through walls with mass of 0

I have a bunch of RigidBodyControl’s that have mass of 3 and the other walls have a mass of 0. The problem is that that the RigidBodyControls with a mass have a linear velocity and they go through the walls for some reason. Any help is appreciated.

i had a similar problem, but i didnt need mass, as it was a static object and didnt need forces acting upon it, so i changed mine to 0 and it didnt fall through, i imagine you will have to change the walls mass so that they match or are greater,

Normally that should not be necessary, objects with mass=0 are infinitely heavy, they simply do not move. To avoid fast objects going through walls use ccd on the RigidBodys e.g. setCcdThreshold(objectRadius);

i tried using the setCccdThreshold() on the enemy rigid bodies, but nothing changed. I also tried using them on the wall’s rigid bodies and nothing happened either. Do I use the setCcdThreshold() on both the wall rigid body and the enemy rigid bodies?

No, read the javadoc on it. It might be ccd does not work as well as in native bullet tho, there seem to be bugs in it in jbullet.

If there is a weak but insufficient force, Increase the mass of the rigidbody controls. Otherwise it’s probably a problem with your code.

if i increase the mass of the wall’s rigid bodies, then the walls start rotating really fast and float away into random areas, they dont stay still.

Leave the walls at 0 and increase the mass of the things that have 3 mass that are not the walls.

@kidneytrader i did that but it still doesnt work, they can still go through walls :confused:

have you done bulletAppState.getPhysicsSpace().enableDebug(true)? maybe your collision shapes are not working as you expect

ive done that, there are a lot of wireframe boxes and they’re in the right place. i dont understand whats wrong with it.