My game is made from pixel art, and therefore all the animations will be made from spritesheets. The problem I’ve come across, is that I have an animation in which the player characters moves their hands away from their body, therefore requiring me to extend specific frames.
When I run the animation, I notice that the entire character moves around slightly by a few pixels. I tried to fix this by making all animation frames have their bounds equally away from the character’s body, but that didn’t work.
The pink rectangles represent each frame’s bounds. And as you can see, the bounds normally end where the furthest pixels of that frame are. So what I did is make each bounds end not where the pixels reach, but instead be the same size as that of the biggest frame’s bounds, so that the bounds of each frame are the same, and the character is always in the same position. As I said, this doesn’t work. Well it does, but it causes the character to shift from their original position (the whole character shifts back slightly for the duration of the animation).
Basically what I want is only for the arms to move, and the legs and rest of the body to stay still within the game space.
Don’t quote me because I’ve still yet to mess with Unitys 2D workflow, but I remember someone else mentioning this in the forum.
If my brain worked better I’d be able to definitely tell you the fix, however I’m only 50% confident this has to do with the individual sprite pivot points. I believe you did step 1 correctly by extending the sprites to match the bounds of the biggest sprite, but I think the pivot points might be causing the character to move around a bit.
If this isn’t correct - searching will surely come up with the answer as I’m sure I remember seeing this asked and answered here before.
Now that you say that, I do remember forgetting (that’s ironic) to change the pivot points of the sprites. I’m not currently at home, so I’ll test it out later, and let you know if it worked.