I have a sprite animation of a character bobbing up and down. On the first frame, he is a certain height, X, then on the second frame, he is still height X. On the third and fourth frames of the animation, the sprite becomes smaller, taking up X - 1 pixels of space with one row of transparency taking up where there were colors before. On these third and fourth frames, the character floats off the ground, which is not desired. What is the solution to this? I would guess it is due to Unity drawing the sprite from the top-left corner and not recognizing it ought to draw the first row of transparent pixels.
Here is a reference image, although it is not my own.