Ok I give up. I don’t usually use animations made in Unity, but when I do, they don’t work.
So far I’ve used animations made in Blender and that works fine. But now I made a simple 360 rotation of an object in Unity and I wanna play it but it won’t work. The animation takes in only the rotation curve of the object.
I did the following and it says the animation couldn’t be played cause it couldn’t be found.
- Made the animation on the object.
- Added the animations into the inspector in Animations component of the object.
- tried to play it with
animation.Play("BarrelRollRight");but it won’t work.
I get this error:
“The animation state BarrelRollRight could not be played because it couldn’t be found!
Please attach an animation clip with the name ‘BarrelRollRight’ or call this function only for existing animations.
UnityEngine.Animation:Play(String)
PlayerController:FixedUpdate() (at Assets/Scripts/Level/PlayerController.js:119)”
Line 119 is the line I posted above ^
What am I doing wrong? Does the animation need to be in some specific location? In a variable? The name is spelled correctly as you can see. Or maybe I’m blind. xD