1
\$\begingroup\$

I got an issue with my character going through the ground and actually going through all other elements with a collider. I'm going to try and show as much as I can of the current state of things.

My character (Human) has a rigidbody component with gravity on. He doesn't have directly any collider on it (only on child elements).

enter image description here

As you can see, an armature is defined on the Human, each part of the armature has it's own rigidbody as well as a collider, as shown in the below picture :

enter image description here

None of those colliders has IsTrigger checked. The Human has a whole doesn't have a collider as this would overlapse with the colliders defined on each part of the Armature.

Now I'm trying to put my characters on a floor object with a box collider. The box collider of the floor is roughly half the height of the character, so it can't be an issue with discrete collision detection. My character at t=0 has no speed and only the acceleration of gravity. Here's how the floor looks :

enter image description here

Both my character and the floor are in the Default Layer and the box is checked in the Layer collision matrix.

Is there anything you think of that I forgot ?

\$\endgroup\$
9
  • \$\begingroup\$ I'm unfamiliar with the Human Ragdoll and Atmos Ragdoll scripts. Are they normally both combined on the same object like this? I'd have expected to see just one ragdoll script responsible for coordinating the body parts' movement. \$\endgroup\$ – DMGregory Jun 10 at 10:56
  • \$\begingroup\$ They are custom scripts, It's a part of the game I'm not working on. What I can say is that during my tests I disabled both those scripts and I still have the issue I described. \$\endgroup\$ – nathan raynal Jun 10 at 11:49
  • \$\begingroup\$ Double check the collision matrix to be sure the player layer is not able to collide with player. If they touch or are already registering a collision on itself it will not work as intended when colliding with another collider. \$\endgroup\$ – Justin Markwell Jun 10 at 13:58
  • \$\begingroup\$ You usually only need one rigidbody on the root of a gameObject. Rigidbodies on its children are usually not required. In a ragdoll scenario they might be, because you might want to calculate the physics of each ragdoll segment individually. But then you wouldn't have a rigidbody on the parent. \$\endgroup\$ – Philipp Jun 10 at 13:59
  • 1
    \$\begingroup\$ By the way, many games solve the problem of having characters which are supposed to act both like ragdoll and like a regular human depending on the situation by having two different modes of controlling the character. A ragdoll mode where each bone is simulated using a rigidbody and a regular mode where the whole character is just one rigidbody and its bones are controlled by an animation controller. But I don't know what kind of game you are going for: Wacky physics simulation or more serious game with occasional ragdoll behavior. \$\endgroup\$ – Philipp Jun 10 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.