title: Override AnimatorController at runtime
body: <p>I have an AnimatorController and want to override it at runtime with another clip. The project should run as WebGL project so it is not possbile to create a new AnimatorController because it is in the UnityEditor namespace which is not exported when building the project as WebGL project (if you have an solution for that you can post it too).</p>
  
  <p>So i tried to use the AnimatorOverrideController but I don't know why the animation isn't playing...</p>
  
  <p>Basic_Run_02 is loaded by default before pressing play and it should be overridden with the clip in the SadWalk.fbx.</p>
  
  <p>Anyone an idea why the animation is not playing?</p>
  
  <pre><code>public class AnimationHelper : MonoBehaviour
  {
  public AnimationClip state;
  public AnimatorOverrideController overrideController;
  
  void Start(){
  
      state = Resources.Load("SadWalk", typeof(AnimationClip)) as AnimationClip;
      PlayMotion (state.name);
    }
  
  
  void PlayMotion(string name){
  
      RuntimeAnimatorController myController = gameObject.GetComponent&lt;Animator&gt;().runtimeAnimatorController;
      overrideController = new AnimatorOverrideController ();
      overrideController.name = "Test";
      overrideController.runtimeAnimatorController = gameObject.GetComponent&lt;Animator&gt;().runtimeAnimatorController;
      overrideController ["Basic_Run_02"] = state;
      //Debug.Log (overrideController.clips.ToString);
      gameObject.GetComponent&lt;Animator&gt;().runtimeAnimatorController = overrideController;
      gameObject.GetComponent&lt;Animator&gt; ().StartPlayback ();
    }
  }
  </code></pre>