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);
}
}