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.
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.
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
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
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.
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.
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!