- Home /
setcurve doesn't work at runtime in some case
at runtime i want to save player bone hierarchy's transform to an animation clip,
clip is created then added to animation component at Start(), save occurs at Update() then that clip is played immediate.
i tried 3 method:
save to a animation asset.
mHelperClip = helperClipAsset;
save to a copy of that asset using instantiate.`mHelperClip = (AnimationClip)(Instantiate(helperClipAsset));
save to a brandnew clip.
mHelperClip = new AnimationClip();
only the first method saves curves successfully as intended, in the other tow case seems no curve is set. and i think the save function is correct.
the drawback of the first one is it uses a shared asset, and it shouldn't be shared in this case. so how to do in the other tow method.
the verstion of unity is 4.1.2f1
Your answer
![](https://koobas.hobune.stream/wayback/20220613100957im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[Solved]AnimationClip.SetCurve error 1 Answer
Scripted Animation Not Playing 0 Answers
Runtime instantiated prefab doesn't animate 3 Answers
Can I make animations snap to a frame? 1 Answer
Possibility of adding animation files during runtime? 1 Answer