Unity — 2d platformer sprite animation in different position


I'm trying to make a simple 2D platformer game. So I got the walking and idle animations working for my sprite, but for some reason when it transitions to the run animation, the sprite is a little off the ground? Does anyone know how I could fix this?

The sprite looks like this in the two animations:

idle:

enter image description here

run:

enter image description here


Answers:


There's a number of things this could be. Here's some things to consider.

  1. Ensure that the location of the sprite hasn't changed. Do this by looking in the inspector.
  2. Look at the anchor point for each sprite, and make sure they are at the same point.
  3. Check for size differences.
  4. Make sure the sprite is cropped correctly
  5. Look at the animation state diagram to see if an unusual state change occurred.

I'm sure I could find more possible causes, but the bottom line is, take a look at everything you can think of that might be causing the issue. If you've tried that, then look around and see what else you can see. Finally, if that doesn't work, try asking here with everything you've tried included.