title: Unity. Cant play animation in animator
body: <p>i'm making a game in 2d and whenever i create an animation sprite, an animator controller is created automatically, i dont know why, i once tried it but i thought it wouldnt be necesary for animations i just want to make in 2d.. so after trying many times to play an animation without the animator (because unity says i have to set the animation legacy, which i dont know where), i gave it a try to play animations in the animator.. i searched through the script reference and wrote the code just like this:</p>
  
  <pre><code>#pragma strict
  
  var velocity : float = 8;
  
  function Update ()
  {
      var movement = Input.GetAxis("Horizontal") * velocity;
  
      transform.Translate(Vector2.right * movement * Time.deltaTime);
  
      if(Input.anyKey)
          Animator.Play("move");
  }
  </code></pre>
  
  <p>the error that unity says is : Assets/PlayerControl.js(12,26): BCE0020: An instance of type 'UnityEngine.Animator' is required to access non static member 'Play'.</p>
  
  <p>so i tried to do this:</p>
  
  <pre><code>function Start ()
  {
      //var anim = GetComponent("Animator");
  }
  
  function Update ()
  {
      var movement = Input.GetAxis("Horizontal") * velocity;
  
      transform.Translate(Vector2.right * movement * Time.deltaTime);
  
      if(Input.anyKey)
          anim.Play("move");
  }
  </code></pre>
  
  <p>and another error occurs: Assets/PlayerControl.js(17,17): BCE0005: Unknown identifier: 'anim'.</p>
  
  <p>i just want to play one simple animation that will just change the sprites. i know how to play animations without the animator.. so please tell me what to do with it.. how to stop unity auto creating animator controller or set the animation legacy, or how to fix this problem with the animator script.</p>
  
  <p><strong>Update:</strong>
  i removed the code code just to make other stuff while i search solution for this but now it seems that animator is running this animation no matter what.. i made another state on it as idle, but then it goes to the animation i created.. i really dont understand this.</p>