These are the following steps I have taken to make animation to play in unity.
-
Added animation controller to the object that I want to animate.
-
Below is the code that I have written for using a particular animation.
using UnityEngine;
using System.Collections;public class PlayerAnimation : MonoBehaviour {
private Animator anim;
// Use this for initialization
void Start () {
anim = GetComponent ();
}// Update is called once per frame void Update () { if (Input.GetKey (KeyCode.A)) { anim.Play ("Action2", -1, 0f); } }}
What else should I do to animate the game object properly.

Here , I put the project into an archive, take a look. https://drive.google.com/open?id=0B2eF3YXmA9z3VDNyT19fRncyRUU
– scardoo