Character Falling Through Floor

Hi all,

I’m having some issues with my character falling through my floor. Right now, my floor is comprised of a bunch of boxes about 1 wu X 1 wu. I read somewhere that having boxes too big could cause the problem, so mine are pretty small, but I’m still falling through.

However, this only happens when I collide with a projectile. My character shoots, and if the projectile is slow enough and the player runs into the projectile, they will sometimes fall through the floor. I can’t figure out what’s going on. My character controls have a mass of 5f, and my projectiles have a mass of 0.2f, so it seems like the issue shouldn’t be there, but it’s pretty apparent something glitchy is going on when they collide, as I’m getting a “bouncing effect” with the camera. Is it simply an “impossible state” problem? And any idea how to fix it? I’d like the projectiles to be able to bounce off the player if possible.



P.S. I searched the forums for a while, and in most of the ones I found it was a mesh problem, so I did play with my floor meshes and my controls with no luck.

Character controls don’t have a mass, they have a step height, try lowering that. Collision shapes also need to be a certain minimal size as well, try increase it and see if you get the same problem. Are you moving the projectile with forces or setPhysicsLocation? Is it 1x1 or is 1 the extent?

1 Like

So I’m an idiot and forgot that they don’t have a mass, and had the step height set weird. That fixed the falling through the floor issue.

The projectiles are moved with physics, the character has both a character control for movement and a kinematic rigid body for collisions with the projectiles (this is for testing, I’d like to have limb accurate collision detection using bone attachment nodes in the future).

However, I’m still getting the jittering, which I’m assuming is because the rigid body attached to the character and must be getting in an impossible state when it moves with the character control and overlaps the projectile’s rigid body.

Any ideas on how to fix this? The only thing I can think of is to use a bunch of ghost controls instead of rigid bodies for my characters body parts, but then I’d have to rewrite all the collision code.

I think normen said the character was a rigidbody kinematic already, and had a ghost control already for collisions. So you shouldn’t need to add your own. Try lowering your box dimensions and maybe increasing the radius of the character control to see if that helps

Well, the point would be having multiple rigid bodies to get a closer to mesh accurate collision system with the projectiles instead of the capsule collision shape I’m using for the character control, kind of like this:

hmm seems i deleted my other post by accident ^^, i’ll try and replicate it.

Ok that is fine, but that won’t be causing you your jittering issues. Kinematic rigidbodies and ghost controls do not “physically” collide. Your jittering is due to the CharacterControl, it is kind of an exception. I would suggest you try playing around with the width/height of the CapsuleCollisionShape and, decreasing the size of the triangles of the boxes, and also playing around with the step height.

Are you using BoxCollisionShapes? I remember someone saying that a MeshCollisionShape helped him. So you can try an imported Cube from blender, and see if that helps as well

After playing with step height, I had no luck. I ended up separating character-projectile collisions and character-geography collisions into two BulletAppStates. This got rid of the jittering and the falling through the floor problem.