- Home /
Switch animation state while keeping animation timing
Hello, I have a question concerning the Unity Animator.
My playable character (a 2D sprite) has a walking animation and a shooting-while-walking animation. They have an equal number of frames, and the idea was to switch over from one state to the other while keeping the time inside the animation so the walk cycle doesn't get interrupted when the character starts shooting.
However, I've had problems implementing this system. My solution up until now was to give each walk and shoot frame it's own animation and set up the state machine like this:
This isn't pretty, but it worked up until now.
But now, we're creating new animations and the frame count turned from 3 to 8 ... so this model would get very messy and unmaintainable. Does anyone happen do know if I can somehow preserve the animation time between state changes?
Thanks for reading and have a great day.