- Home /
Unity can't find animations?
Hey so I'm trying to do this thing where you can open a door by spinning a crank. Now, I made the crank object in Maya and made the animation in unity. using UnityEngine; using System.Collections;
public class Crank : MonoBehaviour {
public bool inRange = false;
//public AnimationClip crankspin;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (inRange == true && Input.GetKeyDown(KeyCode.F)){
animation.wrapMode = WrapMode.Once;
animation.Play("crank spin");
}
}
}
So the inRange bool is made true in a another script, and I know that works. But when I try and press F and make the crank animate, unity gives me this error "The animation state crank spin could not be played because it couldn't be found! Please attach an animation clip with the name 'crank spin' or call this function only for existing animations. UnityEngine.Animation:Play(String) Crank:Update() (at Assets/scripts/Crank.cs:17)" People have told me to set the model to a legacy rig, which I have already done. I drag and dropped the animation onto the object along with the script, but Unity just can't find it! Help?
Answer by Ahma_d0007 · Sep 17, 2015 at 06:00 PM
Goto to animation opendoor and open it in debug mode then change animation type to 1. it works for me.
Your answer
Follow this Question
Related Questions
Unable to mark animation as legacy 1 Answer
Legacy animation system cannot animate colors? 3 Answers
Converting legacy animation to mechanim 2 Answers
How to set legacy on an animation? 1 Answer