title: Change the speed of animation at runtime in unity c#
body: <p><strong>I want to change the speed of animation to my desired speed during runtime of a program.</strong> <em>I have an c# script and animator controller attached to the game object.</em> The default speed of animation in unity is <strong>1</strong>. I set the default speed value of animation to <strong>0.3f</strong>. And during runtime of program, I want the speed of animation to <strong>1</strong>.</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  public class wowBoard : MonoBehaviour {
      [SerializeField]
      Animator anim;
      bool changeSpeed;
     void Start()
     {
        anim=GetComponent&lt;Animator&gt;();
       playAnim();
       changeSpeed=false;
      }
  
     public void playAnim()
     {
       anim.SetBool("show",true);
     }
  
     void Update()
    {
       if(changeSpeed)
          playChangeSpeedAnim();
  
     }
  
   public void playChangeSpeedAnim()
   {
      anim.speed=1;
      anim.SetBool("show",true);
   }
  }
  </code></pre>
  
  <p>The speed of animation did not get change to 1 even boolean value of <strong>changeSpeed</strong> is <strong>true</strong>.</p>