rigning
rigning

Reputation: 155

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

Upvotes: 2

Views: 2058

Answers (2)

DetoxE3
DetoxE3

Reputation: 1

I had this problem too and just fixed it. it's actually simple. What causes this is the pivot of your Sprites. You have to go back to the sprite editor and set the privot of your sprites to the same value and that's it.

Upvotes: 0

PearsonArtPhoto
PearsonArtPhoto

Reputation: 39698

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.

Upvotes: 2

Related Questions