2
votes

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

1
Now you can upload photos, so you make your question of better quality ;)Dhia
It's a bit tough to diagnose the problem since with the information available, it'll just be guesswork. Perhaps your animation state is briefly passing through the jump state (if you have one) before the run state? Or maybe your sprite asset itself was just imported with a lot of whitespace at the bottom?Serlite
@Serlite Mmm i think they've been cropped correctly and are of the same size: prntscr.com/9qu5wh prntscr.com/9qunbx i don't have a jump state right now: prntscr.com/9qulnnrigning

1 Answers

2
votes

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.