1
\$\begingroup\$

Is it possible to control the key-frame/sample value or the time based position in the animator? I’ve set a global float that identifies the rotation of an object on its Y axis and I would like the rotation value to equal/manipulate the time or key-frame in an animation – I’ve converted 360 degrees to a float of 10.00. So.. if I rotate this object to ‘5.00 (180 degrees), it would update to the 300th key-frame/sample or 5.00 seconds into the animation and update every frame from the value changes.

It’s basically scrolling though the position of a cross fade by manually changing the value.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You can use normalised time to jump to a particular frame.

 Animator.Play(state, layer, normalizedTime);

The range of normlaized time is 0 to 1.

For example if your total animation has a rotation of 360 and you rotate the object manually to 180 and want the animation to be played from middle frame. Then you need to give normalised time as 0.5 (i.e. 180/360)

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .