Integrating physics with animations (without ragdoll-like properties)?

So, um, here’s my project: Let’s suppose, I have a character named as “X Bot”. I have animations from Mixamo for it. I’ve made an Animation Controller, and made a script that allows the character model to walk forward, backward, and strafe in both directions. The environment is nothing but a small low poly cube exported from Blender. In this, I’ve added a small hill, to test the character’s ability as handling slopes. The animations work perfectly, as I give Input.

And, here’s my problem: If, suppose, the character has to approach the hill and climb it, the animations wouldn’t work properly. (When I have no RigidBody and Colliders attached, the character just runs through the hill, which I explicitly don’t want. While I add a RigidBody and a Collider to the character, the character just tumbles off the hill. By the way, I’m using a Cube Collider, since the Capsule one just tumbles down even if the character is idle.)

Here’s how I want my character to act like: The character should behave normally on flat ground, and also be able to climb inclines without tumbling off. Also, if possible, the foot of the character should automatically adjust to the incline it is on, that is: the foot should not be flat, instead it should be aligned to the slope.

I’ve seen other topics on this before, but most of them suggest me to use a Ragdoll system. But, I don’t think that is the only solution. Have any ideas?

Suggest researching some of the top selling character controllers on the asset store. A couple off the top are final IK and opsive controller.
Also look into the built in and asset pack IK systems. This will help with the legs adjusting to the proper height. Angle requires math to get working correctly as does the slope angle sliding.

Hm, looks kind of complicated, but I’ll give it a try. Thanks!

1 Like