title: I can not switch animations properly in unity
body: <p>I am making a jumping and idle animations in UNITY 3d.
  Here is the code:</p>
  
  <p>using UnityEngine;
  using System.Collections;</p>
  
  <p>public class JumpingD : MonoBehaviour 
  {</p>
  
  <pre><code>public Animator anim;
  public float JumpSpeed_;
  private RigidBody _Character; //rigid body of the Character
  public Vector3 JumpVector;
  
  /*The thresh Hold level for the character to jump are
      1: Stay Idle
      25: Jump Up 
      */
  void Start () 
  {
      anim=GetComponent&lt;Animator&gt;();
      anim.SetFloat("JumpSpeed", 1)
  }
  
  
  void Update () 
  {
      anim.SetFloat("JumpSpeed", 1)
     if(Input.GetKeyDown(KeyCode.J))
     {
         _Character.AddForce(JumpVector*Time.deltaTime);
         anim.SetFloat("JumpSpeed", 25)
     }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem is the jump animation don't play even after pressed J key.
  Always the idle animation plays
  I want the jump animation to play after I pressed J key and after that the character goes idle again.</p>