My character’s feet sink into ground when some animations are being played and I don’t know how to fix it.
I have the same settings for the capsule collider as in the mecanim tutorial, but for some reason the feet still go through the terrain.
This might not be the answer to your problem but might help someone else. It is an option when an animation is imported. Bake the y position into the pose, then offset it by the opposite amount of how many units you need to move your avatar to touch the ground.
Another culprit could be the skin thickness of the character controller. In that case have the feet of your avatar sticking out of the character controller capsule collider by the amount of the skin thickness.
In my case it was a combination of both problems, in which case it’s probably better to make sure the feet are sticking out of the character controller capsule collider first, then working out the amount to offset the animation in the import settings.
Also, you might want to set the Foot IK check box in the inspector of your animation state. Do this before you set the baked y offset in the import settings.
Hello, I have this same issue, except it doesn’t appear to be offset when the animation is playing, but if the animation is interrupted the player moves down slightly. Applying your fix didn’t really seem to help. I tried testing it out by increasing the offset to an insane amount and talking, it seems like changing the offset doesn’t help, while it offsets during the animation, it reverts back to the normal offset…
I’m using a rigidbody to move, I was using a character controller, but I removed it.
I tried a million different fixes before finding this post, and disabling gravity won’t help like the previous post said, cause as I mentioned, it was still occurring with a Character Controller and I replaced it with a rigidbody to fix it. I also tried setting transition settings to default and the issue still occurred. Sorry to necro, but do you know how to fix this?
I found out the issue WAS the animation, but no matter how much I played with the offset of the animation, it didn’t fix it(I even tried setting it super high as a test, it made the character launch up until the animation was finished, then fall back down)
I fixed it by setting the local position of the armature to 0 if it goes to far down, but it’s more or less a bandaid fix… I’m not really sure how to send the issue isolated, the project doesn’t really have too much in it, but it requires photon as the voice animation is being run through Photon Voice, also calling a lot of RPCs from Photon, so a lot of dependencies just to send you a tester… It’d probably be inconvenient for you if I sent the whole thing, especially as it’s somehow 10gb haha.
I wonder if me figuring out the cause of the issue helps? It’s definitely caused by the animation, it seems the player moves down a slight amount every time the animation is interrupted…
Thank you. Bake into pose for the root transform position (Y) on the required animation (the one responsible for the feet to sink in the ground) works like a charm!!!
Thank you so much