why it doesn't work??

using UnityEngine;
using System.Collections;

public class play : MonoBehaviour {
	
	public AnimationClip anim;

	// Update is called once per frame
	void Update () {
		if(Input.GetKeyDown("e")){
			animation.Play(anim.name);
		}
	}
}

my gameobject Inspector

33608-ppppp.png

And console
33609-pp1.png

use [this][1] link might help [1]: http://answers.unity3d.com/questions/577801/animation-must-be-marked-as-legacy.html

1 Answer

1

Click on the ‘anim’ animation in the project viwe, and change it’s type to Legacy.

I did it but this time nothing is happen, no error or warning but animation clip is not playing.