Search Unity

AnimationClip.SetCurve doesn't work with mecanim animations at runtime

Discussion in 'Documentation' started by Shredsauce, Apr 8, 2016.

  1. Shredsauce

    Shredsauce

    Joined:
    Apr 4, 2016
    Posts:
    37
    http://docs.unity3d.com/ScriptReference/AnimationClip.SetCurve.html

    There's no mention that it can't be used for creating mecanim animation clips at runtime. It only works with legacy animations. It should be mentioned that it acts as an editor script for mecanim animations.

    I really wish it worked at runtime. I spent many hours working on a system for creating animations at runtime only to find out it doesn't work outside of the editor.
     
  2. Alex_May

    Alex_May

    Joined:
    Dec 29, 2013
    Posts:
    198
    Hi, thanks very much for the report. I'm very sorry you've spent time on something that could have been avoided if the documentation had been clearer. I've spoken with the animation team and have been informed that unfortunately at the moment your best bet is to use Legacy animations. I will get the docs for this function updated. Again, apologies - I completely understand your frustration as I've been in similar same situations myself with the docs... one of the reasons I joined!
     
  3. Shredsauce

    Shredsauce

    Joined:
    Apr 4, 2016
    Posts:
    37
    Thanks for reaching out to the animation team. I will switch back to the legacy animation system.