Changing Scale of Collider2D at Runtime

How can I change the size of a Collider2D for a sprite in my scene?

I want to scale it up uniformly so I can test for collisions while allowing for a little space between objects.

Thanks.

If you’re talking about a PolygonCollider2D, probably the simplest thing is have the collider and sprite be separate objects (the collider can be a child of the sprite) and change the scale of the collider object. Otherwise with box or circle colliders you can just change the size or radius.

–Eric