How to change the BoxCollider 2D Xoffset and Y offset by script ?

Hello,

Please someone knows how to change the BoxCollider 2D X,Yoffset in the script, because in my game when i jump i need to change the position of the colldier.

Thanks.

You just need to modify this: Unity - Scripting API: Collider2D.offset.

gameObject.GetComponent().offset = new Vector2(newX, newY);