0
\$\begingroup\$

I am new to unity. I am trying to assemble a character that walks forward, stops, and walks forward again when I maneuver the joystick (ps4 controller) accordingly.

I have the whole thing pretty much set up...

However, my animations broke at some point. Initially, when I added the animations to my character, the character moved with the animation according to the motion encoded in the animations (all of which were auto-rigged at Mixamo...so I am almost certain the bug is downstream in something I did or enabled somehow).

Now, every animation has the character running, turning, jumping etc. in place. Meanwhile, the animation subscreen (when I inspect the clip) shows the character running forward. I tried implementing some fixes I found online; I changed the root motion node to Root Transform, for instance...and that is when the most confusing thing happened: a few of the animations started working...but all of the animations showed the character running in place in the subscreen...so now I have no idea what is happening.

Additionally, the animation clips which do not move the character actually transform the character back to the starting position (actually, that isn't correct--I moved the character into the air to test this; the clips without motion transform the character back to the starting position on the ground).

I have disabled all scripts...so have I somehow broken the animations...??? Re-Importing the animations does not fix them either.


Here are the images of my character settings, then the controller, and then an animation clip which shows the character moving forward in the sub-clip and where motion information is clearly present...

enter image description here

enter image description here

enter image description here

\$\endgroup\$
0
\$\begingroup\$

The problem is caused by: Apply Root Motion unchecked in the animator and "Loop pose" checked on the animation inspector. Which is a setting best suited when you move your character programatically, but it is then harder to get the natural foot cycle.

If you want to keep just part of the root motion, you can "bake into pose". For example Bake into pose XZ will not apply the root motion over axis X and Z.

See : https://docs.unity3d.com/Manual/RootMotion.html

\$\endgroup\$
1
\$\begingroup\$

The problem here is that the animation has it's position set to somewhere around (0,0,0). So, whenever you run the animation, the position is set to 0 (about). I have had this problem in the past, but the way I solved it was by making it a parent of a GameObject. The animation runs on the child, and the movement is run on the parent.

Note: You could switch the child and parent around.

\$\endgroup\$
  • \$\begingroup\$ Ok, awesome--glad to hear you ran into a similar problem, and there is a fix. W.r.t. the child-parent relationship, I'm not sure how I would go about doing that with an imported animation distinct from the model (I was using mixamo and couldn't get the package download to work). Also, to update the question, I restarted the project (I was near the beginning anyways) and could not reproduce the problem with the same configuration... \$\endgroup\$ – donlan Jun 3 '16 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.