how do i change the size of the collider when changing animation

you see, i have a character in 2d that is sorta like a spider, but with 4 legs, when he walks, the legs spread a little wider than when he stays still, the thing is, i need to change the collider when he is walking

In fact, i also noticed that the walking sprite has an offset because is a different size than the idle sprite, how do i change the offset of one sprite without affecting the others, and how do i change the collider only when is in the walking animation?

how do i change the offset of one sprite without affecting the others

select the sprite you want to modify, open the sprite editor and will see that each frame has a blue circle. It’s pivot, a reference of where is the center of the sprite which you can adjust.


how do i change the collider only when is in the walking animation?

Have a reference to the collider in your code and change the collider.size from there. To know when to do this, set up Animation Events in the walk animation.


PS.: Avoid making more than one question per post.