title: Unity 5.4 C# Animation Play/Stop
body: <p>I'm trying to play/stop animations with C# codes but they didn't worked, Javascript code work (legacy mode). I hope someone know where is problem.</p>
  
  <p>C#:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class PlayStop : MonoBehaviour
  
  {
    public GameObject Cube;
  
  
    void PS()
    {
       GetComponent&lt;Animation&gt;().Play();
    }
   }
  </code></pre>
  
  <hr>
  
  <p>JS:</p>
  
  <pre><code>var Cube : GameObject; 
  Cube.GetComponent.&lt;Animation&gt;().Play();
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/TRpkl.png" rel="nofollow">C# Screenshot</a></p>
  
  <p><a href="http://i.stack.imgur.com/a8LAp.png" rel="nofollow">JS Screenshot</a></p>