- Home /
Question by
BigToe · Nov 23, 2010 at 04:52 PM ·
animationcurvekeyframe
Accessing Animation Curves/Keyframes during runtime
Is there a way to access animation curves and their keyframes during runtime? I would like to be able to get the value at each keyframe of my animation so that I can draw a path during the game.
I realize there is the AnimationCurve type, and you can set a curve, but it doesn't look like you are able to get a curve from an existing clip during runtime.
Thanks
Comment
Best Answer
Answer by Paulius-Liekis · Nov 24, 2010 at 01:54 PM
You can use AnimationUtility.GetAllCurves, but that's an editor class, so you can call it in Editor only. I remember drawing curves in runtime, but I can't remember how I did that. Maybe I just extracted the keyframes in Editor and then rendered in Runtime.