2
\$\begingroup\$

I have an animation and I modified some rotations of some bones in the animation at a certain frame. What I want to do is how to make the animation in the next couple of frames interpolate smoothly so that the changes I made looks smooth? Like for example, if I have an animation of a game object, and in frame number 100 it rotated 90 degree in the x-direction. So now frame 100 has a modified rotation angle of the object, but frame 101 has the original animation. I want to smooth the rotation so that the transition of the obect from the modified frame back to the original animation looks smooth.

\$\endgroup\$
1
  • \$\begingroup\$ You would most likely need to delete the animation for the right arm starting at frame 101 up to the frame where you want the original animation to resume and let Unity interpolate from 100-to-whenever. \$\endgroup\$ – Jeremiah Leslie Jun 10 '15 at 18:45
1
\$\begingroup\$

I did not understand completely what you wanted to do but I can give you some tips on frame perfect animation.

If you use a controller (in the script sense) for your animation, you can manually select what each frame does. ie;

int frame = 0;
void Update(){ //runs once per frame
    frame++;
    if(frame % 2 == 0)
        //even frames code
    else
        //odd frame code

}

Other usefull tips you can use are

ticks += Time.deltaTime; //says how much time has elapsed since the last frame
Math.lerp(a,b,ticks);    //you can use this to smooth out animations in the update

best of luck

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.