My animator does not work anymore

after done everything in this video and looking back and forth to my code i can’t see my fault but for some reason my update animator does not work anymore, my character is floating above ground when i want to walk


The code looks correct, so it’s time to take a look at the animator itself…
Things to check:

  • Make sure that the Animator’s avatar and AnimatorController are correct
  • Make sure that the AnimatorController’s variable is set to “MoveForward”

Post a screenshot of the Animator’s inspector with the Blend Tree selected (so we can see the animations and their settings) and we’ll take a deeper look.

yea i thought the same and looked at it too but nothing seems to be out of the ordinary
as you can see my blend tree is also called MoveForward which is why it’s that in the code


One more thing to check:

  • Make sure there is no animator on a GameObject under the Player, you just want the one on the root of the player.

Other than that, everything looks right… if that didn’t do it, zip up your project and upload it to https://gdev.tv/projectupload and I’ll take a look at it tonight.

I sended the file to you, only the player prefab had the character animator on them and ofcourse the avatar, the prefab of the asset it self only had the avatar on them, which didn’t change if i unequiped that.

thanks in advance tho

This is why I prefer pasting/formatting text over screenshots.
It turns out that the Mover’s Update method is misspelled, update() versus Update(). It’s hard to spot sometimes, and it took a Debug showing that UpdateAnimator was never being called for me to spot it. The Unity Callback functions (Start(), Awake(), Update(), etc) require precise capitalization. Sorry I didn’t spot this sooner.

thanks for the responses and looking into it, i can’t believe i did look over that, i checked the code more than once, how do you pasting/formatting text here?

thanks again for everything and the quick responses i can continue now

On it’s own line, type three backwards quote marks ```, the one next to the 1 on your keyboard. Then copy the code in your code editor and on the line immediately after the ```, and at the end of the code, type another ``` to complete the code block.
For example:
```
void foo()
{
bar();
}
```
becomes

void foo()
{
    bar();
}

Note that in the example, the bar is not indented, but it actually was indented when I typed it in, the forum editor strips leading whitespaces unless you’re in a code block.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms