- Home /
Alternative To "SetEditorCurve"?
Hey guys, after upgrading to Unity 4, I've gotten this error with a script I have which essentially applies one animation to another character.
Assets/Editor/ConvertAnim.js(63,42): BCW0012: WARNING: 'UnityEditor.AnimationUtility.SetEditorCurve(UnityEngine.AnimationClip, String, System.Type, String, UnityEngine.AnimationCurve)' is obsolete. This overload is deprecated. Use the one with EditorCurveBinding instead.
I'm not entirely sure what all of that means, but I'm guessing I have to use a different function instead of "SetEditorCurves", What's the new alternative to this?
Answer by nicloay · Feb 11, 2014 at 07:59 PM
check your ConvertAnimscript and instead of this construction
clip.SetCurve(bonePath, typeof(Transform),"localPosition.x",curveX);
use following one
AnimationUtility.SetEditorCurve(clip,EditorCurveBinding.FloatCurve(bonePath,typeof(Transform),"m_LocalPosition.y") ,curveY);
otherwise editor can show correct tangents, but wrong additional settings (like broken or linear tangents)
Your answer
![](https://koobas.hobune.stream/wayback/20220613123718im_/https://answers.unity.com/themes/thub/images/avi.jpg)