2D walking animation lagging in game

Hi, guys,
I created a set of 28 frames 2D walking animation for my character, all of them are 600 * 600 px.
They were imported as a 3600*3600 px sprite sheet and cut by sprite editor.
The filter mode is bilinear, and the max size is set to 4096, compressed.
Then I import the frame sprites to animation controller, and set sample to 35.
The animation works fine (no frame lose) when I test it, when the character is at the same place.
But when I move the character in the game (arrow keys), the walking animation start to lag,
I’ve notice that unity skipped some of the frames of the animation, which gives me a big headache.
Can anyone give me a suggestion how to correct this?
Big thanks guys!

I figured it out. It’s because I used rigid body.velocity to move the character, which is the most common method showed in tutorials. And then one thing, I need to set the rigid body 2D → interpolate to interpolate, so unity can do a pre-frame rigid body check,.

1 Like

old question but, how did you move your 2d character without velocity?

You can use transform.translate which moves it directly instead of adding acceleration