- Home /
Character feet position is not alaways on ground
Hello, I am new to managing animations with unity.However i have got walk cycle and jump animation to a character where the character change position with animation i.e. keyframe.But the problem is the jump animation landing base and walk animation base is not the same, so i cant land the character with jump animation on the ground rather up above.I also added gravity with rigid body, but the character wont come down as it is in keyframe. Is there anyway to fix this with scripting or any other way like adding any compomnt?
I think there is no real good solution.
You may have to move some keys in your animations. An other solution is to add an animation component to your character which will animate your capsule/collider while your character lands from a jump, to be sure that the feet don't go threw the floor. But you have to be very careful when you do this kind of animation because if your collider goes just a little bit under the floor, your character will fall entirely ...
hmm i think i have to change the animation then i think
Answer by JamieFristrom · Nov 13, 2012 at 06:35 PM
I spent some time seeing if I could do this with Mixamo's 'action heroine' asset, and my conclusion is that it can be very difficult to adjust the animation if your character's skeleton and animations are set up the same way theirs is: their pelvis object has lots of keyframes and there's no convenient way to adjust all the keyframes up or down together, and there's no unanimated top-level node in the skeleton you can simply adjust.
So I came up with this hack: assuming you're using a Character Controller, how high Unity renders your anim depends on the Character Controller center.Y. And you can 'animate' that - give it a starting and ending keyframe with the adjustment you want. Warning: if you adjust it too far, your character might fall out of the world as they transition between animations.
I made a video to demonstrate how to do it here (complete with character falling out of the world) - watch it in high quality - http://youtu.be/dEISl5dhxzU
This is all for Unity 3 - apparently the animation window is now 'legacy' - I'm not sure what's going to replace it in Unity 4.
And if you have the resources, it's probably better and simpler to find a consistent set of animations...
thanks for your suggestion, i'll try to follow your directions
There are some videos on how to do it (I recall watching one from a Unity conference in 2011, I think) - but it's violently complicated. After your animations have run, you've got to procedurally perform some basic I$$anonymous$$ to bring the feet onto the ground.
This does give you the advantage of making the walk animations suit almost any terrain, but it's very time-consu$$anonymous$$g to get right, and it has to be re-applied every frame (unless no animation is playing).
Your answer
Follow this Question
Related Questions
Attaching First Person Controller to Kinematic Rigidbody 1 Answer
Positioned Blender models with animation snap back to 0,0,0 1 Answer
In animations, is it possible to only add transform values instead of setting it? 2 Answers
Run Animation Rotation - Position 1 Answer
teleporter not working due to animator 0 Answers