Character bounds with different sprite sizes

Hi. I’ve the following problem:

I’ve a character that when is idle, let’s say… it’s 90 px wide, but when the punching animation occurs, it increases to 120 px.

How do you deal with different sprite sizes on position, rendering and boundries? Because if I do the following:

You can see that when the character is idle it is the same width that when it’s punching and this leads to improper collision detection.

My only guess is to offset all frames x - (width / 2) in the rendering code.

Originally, this images where not all the same size… I made them with Photoshop to be the same size to make it easy for me to render, but the sprites where all with varying sizes, like this:

And the problem with that is that all animations where off-center from each other and the character width was dependent on the frame size and I just couln’t properly sinchronize all frames through math alone. I could’ve put an offset for every frame manually, but I find this cumbersome.

How do you usually deal with this?

Am I in the right path?

Disclaimer, I am not an expert.

But I’d say, in that sample you should keep one anchor point, that could be the right leg. Because this is theoretically what should happen in reality, if he punches, he moves the left one behind and keep his weight on the right one.

That could be, but I have to make an offset for every frame to determine where the leg should be.

I’m currently using a default width (when the character is idle) and aligning the rest of the animations to it, but some animations don’t play right, like in this video:

I7C93gMu06c

The punch is right, but when the character is “hit”, you can notice that the leg slides to one side.