I’ve written a script that parses a series of .json files and converts the data into an AnimationClip. When I look at the animation curves in the Animation window, it looks like everything is correct, but when I drive the animation of a Transform with the clip, I’m seeing numbers in the inspector that don’t correspond to the animation numbers at all.
In the screen below, you can see how my scene is configured. The animation clip is on an AnimationTrack on a Timeline. The values for the current frame of the animation do not align at all with the values in the inspector. The transform is at the top of the scene hierarchy so there is no conceivable way that some kind of scaling transformation is effecting the position.
Here is the applicable code I use when setting up the animation curves on the AnimationClip before saving it to the asset database:
clip.SetCurve( "", typeof(Transform), "localPosition.x", posXCurve );
clip.SetCurve( "", typeof(Transform), "localPosition.y", posYCurve );
clip.SetCurve( "", typeof(Transform), "localPosition.z", posZCurve );
It all seems pretty straightforward to me, but this is the first time I’ve created AnimationClips in code so maybe I am missing some critical step/setting?
Can anyone help?
