- Home /
EditorCurveBinding.FloatCurve propertyName for scale
Hey,
I'm trying to generate animations via script with SetEditorCurve. For the position this would look something like this:
AnimationUtility.SetEditorCurve(zeroToRad, EditorCurveBinding.FloatCurve("", typeof(Transform), "m_LocalPosition.x"), AnimationCurve.EaseInOut(0, 0, duration, radPos.x));
Now I'm also trying to change the scale of the objects, but on the doc site http://docs.unity3d.com/412/Documentation/ScriptReference/AnimationUtility.SetEditorCurve.html I can't find the name for the parameter that changes scale. I tried "m_LocalScale" and I don't get error when runing the script, but in the animation view it says: Scale.x (Missing) in yellow. This is the code I used:
AnimationUtility.SetEditorCurve(gridToRad, EditorCurveBinding.FloatCurve("", typeof(Transform), "m_LocalScale.x"), AnimationCurve.EaseInOut(0, 0.2f, duration, 1.0f));
AnimationUtility.SetEditorCurve(gridToRad, EditorCurveBinding.FloatCurve("", typeof(Transform), "m_LocalScale.y"), AnimationCurve.EaseInOut(0, 0.2f, duration, 1.0f));
AnimationUtility.SetEditorCurve(gridToRad, EditorCurveBinding.FloatCurve("", typeof(Transform), "m_LocalScale.z"), AnimationCurve.EaseInOut(0, 0.2f, duration, 1.0f));
So what am I doing wrong and how can I actually set the scale of a animation via script.
Cheers, Max
Your answer
Follow this Question
Related Questions
code animation on multiple properties using one AnimationClip 1 Answer
why I have to anim.getComponent in update() function when I had done in Start () function 2 Answers
First script plays animation but second script stops if from playing said animation 1 Answer
Scale up/down animator not staying at the scale once the animation finishes 2 Answers
Animating a Panel,Animating a panel 1 Answer