Animations with the Animator not working

Hello,

I’m new to Unity, and running into an issue. I was already following a couple of tutorials, but looks like there’s an issue i cannot fix after hours spent on it:

My character (an animated rat purchased on the Asset Store) has an animator controller with the different animations that are set properly with transitions and parameters. But in-game, the animations don’t run. As you can see on the provided screenshot, the animations run in the Animator, but not in-game. I tried to switch between different default animations, parameters, and variables. None of the animations are working in-game.

However, when I put, say the Rat_Walk animation, as an Animation Clip on the Player, the animation plays in-game. But that’s not what I need.

I later found out there’s no Motion (on the right), and I cannot set it to any of the Rat animations. I can set it to any other animation though. Even the Take 001 animation that came with the rat, which is grouping all 5 rat animations. If I set this one, then it works, but playing the Take 001 clip, not the individual ones. Still not what is wanted here.

So, would this issue be related to the animations themselves? How to fix it?

Based on the images this rat is going to be player controlled?
If that is so - look into the animation part of the learn section. Your doing some of the steps, but not all of them. The answers you seek are there.
And unless you are preforming advanced animation techniques - you don’t want to have an animator and an animation component on the rat. You will want to remove one or the other.

Yes, the rat is player controlled.
I was following a tutorial again, but to no avail.
It is working on other models though.
What seems to be missing to work, is the clip in the Motion field.

Have you linked input to Animator parameters? I see some parameters in the Animator window but the should be tied to the controls.

And yes, you have to assign an animation clip to each state in the Animator window.

Yes, input are linked, and working. The different animation states are running, as mentioned, but no animations.

I noticed something else.
When I select one of the animations in the Animator, there is no animation displayed below.

Whereas with the spider model, its animations, and the animator I set for it; animations are properly displayed below.

What could be causing this?
I am clueless.

In the inspector with rat idle2 selected in the motion field - there is none (motion). Place the idle2 animation into that field.

As I said in my first post above, I can place any other animation in the motion field, except those coming with the animated rat.
Outside of that, they work if I put them as an animation clip. But this is not what is expected here.

The separate animations were generated from the original Take 001 correct?

If you duplicate the idle2 animation can you then assign the duplicated animation to the motion field?

I cannot duplicate them.
They come as follows:

Did you ever figure this out? I’m experiencing the same issue.

select your rat model and click the rig part on the center tab in the inspector, change the animation type to humanoid, then drop animation into the state machine it will work fine :slight_smile:

1 Like

GOT IT
Do this:
Go to your animator controller → open your animator controller asset(state machine) → click on every animation and look at the inspector → in the “motion” field drag your animation clip. Do this for all the animations. Hope it helps :smile:

1 Like

Hey!! 100% working !! go to the model and animation in the asset browser and change the rig to generic…It will surely work

Wanted to chime in here as I finally noticed that my issue wasn’t that the animations weren’t applying, but that the changes weren’t being rendered due to static batching being turned on. I’m not sure what other sort of workaround there is to this, but I went to Edit → Project Settings → Player → Other Settings and unchecked Static Batching and voila! Right as rain.

1 Like

I highly doubt static batching has anything to do with OPs issue. Most likely the animations were simply the wrong type. The first screenshot shows them in the legacy Animation component which means the animations are probably set to legacy. But legacy animations cannot be used in an Animator Controller so they simply won’t work.

And they should never have had both an Animation and Animator component on the same object. You can’t use two entirely different animation systems at the same time.

Thanks, This was the solution for me.

Thank you! This fixed the issue for me. I could not understand why my simple door open animation wasn’t working and spent about 2 hours trying to figure it out. Once I unchecked Static Batching, it worked perfectly!

Go to ANIMATOR component → right click → click on OPTIMIZE TRANSFORM HIERARCHY.
I don’t know how it works but it works!

Worked for me! DEOPTIMIZE HIERARCHY

It work for me