Locomotion System not working: character not moving

I am facing a very strange problem with the Locomotion system:

When I run the game, the character stays in idle animation and does not respond to the player’s input. It does not move at all. If I disable the “Leg Animator” script, the character responds normally to the player’s input (but of course it is not animated).

  • I am using a custom character but its skeleton is strictly identical to the skeleton of the human character in the Locomotion system package. Same hierarchy, same bones names. The proportions of the bones are different though.
  • I followed the tutorial supplied with the Locomotion system for the setup of the character.
  • I only added one idle animation and one walk animation.
  • At first I created temporary animations to setup the system and everything worked fine.
  • But I have now replaced those temporary animations with the final animations and now the problem occurs.
  • The animations are exported in FBX from Maya.
  • If I duplicate the character in the scene, one using the temporary animations and the other one using the final animations, only the character using the temporary animations is moving around. The other one stays at the same place.
  • If I put the character in the “Motion Analysis” scene provided with the Locomotion system, the final animations are played normally and all the informations (curves, trajectories, footprints, etc) are displayed normally.

I don’t understand how and why the “Leg animator” can block the movements of the character.
I don’t understand what is wrong with the final animations.
I really don’t know how to fix this problem.

any help will be much appreciated. =)

When you say that the character doesn’t respond to the player’s input, do you mean that it doesn’t move at all? (deckard replied yes to this in previous conversation.) If so, you have some problems with scripts not related to the Locomotion System, because the Locomotion System doesn’t control movement at all; only animation.

To clarify, the Locomotion System does NOT touch the character GameObject’s transform at all (it reads it but doesn’t modify it) so it cannot be the Locomotion System that is responsible for the character not reacting to the player input. Only exception would be if it’s setup wrong with the character transform passed in as the root bone. Here’s what the Locomotion System docs say about the root bone:

Please check that the animations play as expected when used without the Locomotion System. One of the big source of problems people experience come from animations that don’t work correctly in the first place, so always test animations inside Unity in isolation. E.g. set the default animation of the Animation component to your run animation and enable Play on Awake and then test that your character responds correctly to player input now, without the Locomotion System.

Essentially, you say that you have two instances of your character, one that works and one that doesn’t. According to you, the only difference is the animations. So you need to investigate what the difference is in those animations that make one set work and one not. Specifically, I’d suggest you use the Animation View to look which curves the clip contains, e.g. which bones have curves for position, rotation, and/or scale. It’s fairly probably that the problem is related to that, if the animations are really the only difference between your two characters.

So if your problem persists, please reply with the results of testing your run animation together with the character input scripts, and please reply if there are any differences in which bones have curves for position/rotation/scale between the animations that you say work and the ones that don’t work.

Rune

Thanks for this detailed explanation Rune.

I have tested both characters without the locomotion system but enabling the walk animation as the default animation as you suggested.

When I use the temporary walk animation, the character responds normally to the player’s input

When I use the final walk animation, the character does not respond normally to the player’s input and remains at the same place.

So the problem comes clearly from the animations themselves. But what should I modify in the animation to make it work?

I’m not sure why those animations cause your character to no longer move according to your input script. It depends on the details of the animations and your script.

I still think you might get clues from using the Animation View to look which curves the good and the bad clips contain, e.g. which bones have curves for position, rotation, and/or scale. There’s a guide on how to use the Animation View in the manual if you are new to it. Maybe the bad clips have curves for transforms that the script is trying to move, hence overwriting the positions set by the script, or something similar.

Rune

I think that I found the problem, although I don’t know exactly how to fix it.

This is what the “hero” character supplied with the locomotion system looks like in the “project” window:

Hero Artwork (the directory)
Hero (the imported model)
Hero (the mesh)
Hero (skinned mesh renderer + materials)
Reference (the root of the bones hierarchy)

Here is what my model looks like in the project window:

Armstrong (the directory)
Armstrong (the imported model)
Armstrong (the mesh)
Armstrong 1 (it doesn’t have a skinned mesh renderer nor materials but for some reason it works anyway)
Reference (the root of the bones hierarchy)

If I open the Animation window and look at the curves for each part of the “hero” model, here is what I get:

Hero (the imported model) → no animation key
Hero (the mesh) → no animation key
Hero (skinned mesh renderer + materials) → some animation keys
Reference (the root of the bones hierarchy) → some animation keys

If I open the Animation window and look at the curves of the “Armstrong” model, here is what I get:

Armstrong (the imported model) → some animation keys
Armstrong (the mesh) → no animation key
Armstrong 1 → no animation key
Reference (the root of the bones hierarchy) → some animation keys

In addition, the temporary model which works is similar to the “hero” model with some animation keys on the skinned mesh and bones hierarchy but without any animation key on the imported model.

I am pretty sure that the problems come from these unwanted animation keys on the imported model. Does anyone know how to fix this?

I eventually managed to fix the problem.

The rigging artist who did the rigging and skinning of the model in Maya has added a series of controllers which were then used by the animator to create the animation. So in Maya the bones are driven by the controllers.

Before exporting the animation to Unity in FBX, I need to bake the animation of the bones and remove the controllers, which are useless in Unity.

During this baking process, Maya was generating a series of keyframes for the transform of the model. Those keyframes were setting the position of the transform at 0,0,0

So in Unity, the input of the player was overwritten by those keyframes, thus maintening the character at its original position.

Thanks again Rune for your help and detailed explanations! =)