- Home /
Moving model with animation
I am trying to import a Model with animation and when I have the animations stationary the Mecanim works frine. But when I have the animation move forward in the animation my player walks away from the Transform position and the transform cursor falls behind. what the heck is going on?!
IF the animations are stationary my player doesn't move In-Game that's why I animate the model walking forward then apply the animation to the avatar for mecanim
Thanks for the info guys a lot of what you've said has helped. However, I have one more question because I have been able to get my character, skeleton and animations into unity, they work as they commanded. However, my character will float while running until I release the W,A,S,D key and then he drops to the ground. Why is this? I have my animations setup so that in blender he moves forward, left, right etc. Should I have him as just stationary? Or should I keep him with moving animations?
Answer by steakpinball · May 31, 2014 at 12:00 AM
You should look into the Apply Root Motion options of mecanim. They take the change in position in an animation and apply it to the transform of the object.
Answer by meat5000 · May 31, 2014 at 02:04 AM
Blender model?
PlayerGameObject --> Contains Animator, rigidbody(if req), Character Controller? Etc
--> (Child) Mesh --> SMRenderer (Change Spine to Root/Master)
--> (Child) Armature --> Blank
Remove Character Motor. Make Rigidbody Kinematic. In this case, Character Controller is just for gravity and standing Upright, dealing with slopes etc.
Your motion is still being handled by another component. The part of the object which is moving away has got the displacement from this script added to the displacement created by root motion and so gets away from the other parts of the object.
Follow the above structure and see how that works out for you. Rigidbody not required.
Your answer
Follow this Question
Related Questions
Mecanim blend moves character? 1 Answer
Multiple movement modes in mecanim 0 Answers