- Home /
Keeping Character Grounded
Hey so im working on a rather complicated and in-depth character movement system for my game. im using various animations with root motion (standing, crouching and prone). i have a dynamic character collider that is separated into 2 parts the top and the bottom the top is from hips/waste up and the bottom is for the legs.
Because my capsule collider is dynamic its changing size and rotation depending on the animation, which means its not always touching the ground. which causes my character to slightly fall then pop back up. i also have a basic grounded system to check if the player is grounded(simple raycast with timer) but needs to be updated.
as you can see this animation of my character running looks to be on the ground.
but this animation while prone is floating because of the dynamic collider
so here's my question: how can i keep my characters root the be level with the ground(as long as the player grounded). could i raycast a ray from the hips downwards and if im grounded then set the root position to the hit.point? would this work even if my collider will be slightly in the ground at some points?
Thanks for reading ~Scott
Your answer
Follow this Question
Related Questions
Pallet falls through forks 2 Answers
Collision detection for many colliders 0 Answers
Collision Precision 1 Answer
Does unity take disabled colliders into account with the collider limit? 1 Answer
Using cylinder colliders as wheels. 1 Answer