Hello,
I’m working on a 2D game on Unity. I need to parse values of transformations (position, rotation etc.) from Animation Clips (*.anim files) and use them in my code.
So I need to know sprite’s position, rotation etc. on every frame. It looks something like here if I open *.anim file in text editor:
m_Curve:
- time: 0
value: {x: 0, y: 0, z: 0}
- time: 0.0625
value: {x: 0, y: 2, z: 0}
- time: 0.125
value: {x: 4, y: 14, z: 0}
Is there any API how can I get these values for particular frame? I expect something like here (pseudocode):
animator.GetAnimationClip("jumpAnimation").GetValue(parameter, time);
where ‘parameter’ is a name of parameter which is animating with time (like position, rotation etc), ‘time’ - is a frame on timeline or just time, ‘jumpAnimation’ - animation clip name.
Would appreciate if you help me with advices.
Thanks,
Andriy