Change collider2d size and also move it down in relation to Game Object

I have a box collider 2d on a player object. When I’m running and standing, I want it to stay as it is but when I roll I want it to be a smaller size.

I can change the size of the box collider just fine but when I try to move the smaller collider down the y axis so it “sits” on the ground, my Game Object is move up the y axis as well.

void Update()
    {
        handleInput();
        if(rolling == true)
        {
            myCollider.size = new Vector2(.2f, .28f);
        }
        else
        {
            myCollider.size = new Vector2 (.15f, .56f);
        }
    }

It looks like you’re increasing the x value in the code you wrote.

If you look in the inspector, is the ‘offset’ what you’re looking for to lower its position? Try, in edit collider mode, to move the offset and if that’s what you want you could try to code that. I am unsure why your object is moving up on the y axis, unless it’s to do with expanding the x portion of the collider and rotating/rolling…