- Home /
The unexpected noise of animationCurve when making it with a script?
Hi, I'm trying to make my own animation using a script. I followed the script reference in unity documentations, but the result is confusing. here's some of my codes.
for(int i = 0; i < count; i++) {
...
posXKeys[j - startIndex][i] = new Keyframe(time, bones[j].localPosition.x);
}
...
...
AnimationCurve curve = new AnimationCurve();
curve.keys = posXKeys[j - startIndex];
clip.SetCurve(relativePath, typeof(Transform), "localPosition.x", curve);
and when the scipt has executed, the result animation looks like this:
the keyframes are correct. BUT there're some annoying noise between these keyframes. They are supposed to be straight.
Does ANYONE have ANY idea what's going on? How to fix this? It's driving me crazy...
Also, these keyframes' both tangents is 0, and when I tried to edit the animationCurve on animation window, even a slight change can make these noises desappear...
Because of the way your doing this, can't you just set the interpolatioon between points to linear?
how to create the linear curve using a script? I can't find it in the documentation.
Your answer

Follow this Question
Related Questions
Parameterized Animation Clip 0 Answers
What is the math behind AnimationCurve.Evaluate? 5 Answers
Animate mode does not contain definition for GetCurveBindings 2 Answers
How do I scale just the time portion of the animation view timeline? 2 Answers
Keyframe animation WITHOUT curve (Sprite Animation) 1 Answer