How Do You Add Or Remove Clips At Runtime With Mecanim?

How Do You Add Or Remove Clips At Runtime With Mecanim?

Symptoms

  • I want to add or remove animation clips in the animation controller at runtime.

Cause

You are trying to do one of the following:

  • Set up a new animation clip at runtime using Mecanim.
  • Change or Remove an animation clip during runtime.

Resolution

It is not possible to add or remove clips at runtime with Mecanim, but you can override them with AnimatorOverrideController to dynamically change the animation clips.

 

More Information

In Unity 5.2 there is a new Playable API that will allow you to play clips on Animator components without a controller.

This article applies to Unity version 5.1.1f1

Was this article helpful?

Related Articles