PolygonCollider2d size doesn't match

Hey there,

i still have a problem with polygoncolliders attached to procedural sprites while runtime. they are always some pixels to big, no matter which size and pixels to units i choose.
It is all completely generated while runtime, so there are no premade tile sets and no chance to fit the polygoncollider manually.


i tried:

  • different sizes of sprites
  • imported sprites
  • different pixels to units ratios

Thx for your ideas

I think in another 2d collider post it was mentioned that the collides are automatically set a fraction larger than the sprites. You might be able to change the scale of the collider with code in it’s start function if you know how much you need to scale it by (if the gap is the same each time the object is instantiated).