title: unity animation.play() doesn't work
body: <p>i have a simple script that should animate my player but its not working. i read forums for a while, some had issues about animation legacy option and i fixed it, but my character still doesn't animate, and there isn't any compiling errors. Here is my script:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class maincharacter : MonoBehaviour {
  
      void Start () {
      }
  
      float xSpeed = 10f;
      float zSpeed = 10f;
      public float playerMovementSpeed = 10f;
  
      void Update () {
         float deltaX = Input.GetAxis ("Horizontal") * xSpeed;
         float deltaZ = Input.GetAxis ("Vertical") * zSpeed;
  
         Vector3 trans = new Vector3 (deltaX + deltaZ ,0f,deltaZ - deltaX);
         transform.Translate (trans.normalized * Time.deltaTime * playerMovementSpeed, Space.World);
  
         animation.Play ("mcrunsw");
  
         /*if (deltaX != 0 || deltaZ != 0) {
                   animation.Play ("mcrunsw");
            }*/
      }
  }
  </code></pre>
  
  <p>Here is my gameObject and animation:
  <img src="https://i.stack.imgur.com/5LVuw.png" alt="enter image description here"></p>
  
  <p>Any help would be appreciated. Thanks in advance.</p>