- Home /
animation length, changing speeds quandary
I'm trying to set up a system where I can lerp enemy attack animations to a stop, wait, lerp back to normal speed, and finish, in an effort to allow telegraphing attacks.
The easiest way for me to describe the whole process is in narrative-code, heh:
-lerp anim speed from defaultAnimSpeed -> 0 over timeToPause second
-wait for waitTime seconds
lerp anim speed from 0 -> someSlightlyFasterAnimSpeed over timeToSpeedUp seconds
-wait for remaining duration of animation
The ultimate goal being: so I can set timeToPause, waitTime, timeToSpeedUp, and remainingDuration in the editor, and they should add up to what a complete cycle would be.
The problem is: I don't know how to solve for what "someSlightlyFasterAnimSpeed" should be, in order to guarantee the amount of time the remaining duration of the anim takes equals remainingDuration?
Your answer
![](https://koobas.hobune.stream/wayback/20220613073405im_/https://answers.unity.com/themes/thub/images/avi.jpg)