Hi,
I’m trying to procedurally define an animation that would move an object along X first and along Y next. here’s how I do it:
AnimationCurve curve = AnimationCurve.Linear(0, 10, 2, 20);
AnimationClip clip = new AnimationClip();
clip.SetCurve("", typeof(Transform), "localPosition.x", curve);
AnimationClip clip2 = new AnimationClip();
AnimationCurve curve2 = AnimationCurve.Linear(0, 1, 2, 3);
clip2.SetCurve("", typeof(Transform), "localPosition.y", curve2);
// along X
animation.AddClip(clip, "test");
bool res = animation.Play("test");
// along Y next
board.animation.AddClip(clip2, "test2");
board.animation.PlayQueued("test2");
Both animationa play sequentially but after the object’s been moved along X it’s last position is reset to its initial position and then Y animation is played.
How can I still have the last frame of the animtion be applied once the next anim starts playing? I also tried using clip.wrapMode = WrapMode.ClampForever for the first anim but in this case the second one is never played.
thanks!