There has to be a way to generate a pixel perfect 2D polygon collider. Even with an image as simple as a 20x20 pixel black circle surrounded by a transparent backround Unitys default polygon collider fails to generate around the corners of the pixels. I don’t want an answer saying “You can hold shift + ctrl to add and remove vertices.” I want an answer with results.
Preforming the tedious task of moving vertices to match up with grid lines is already a painful task. But becomes that much worse when you want to make a 360*240 custom sprite. Along with the fact that there is no snap settings for collider verticies, the job is a waste of time.
I’ve looked through post after post and I have seen paid assets, broken links, and the old “Add and remove vertices using shift and ctrl.” There has to be a better way using scripting or even a free asset. I have tried making a 3d mesh of the object which doesn’t work due to the fact that the 3d and 2d physics engine do not work the same.
There needs to be a solution to a pixel perfect 2d polygon collider generator.
Yes, it's a reasonable feature request. I think the only way to make it happen atm is to write your own Editor extension. It wouldn't be too hard to write an Editor window that replicates the polygon collider editor functionality but includes snapping. Even simpler would be a simple function that goes through each point in the polygon collider and snaps it to the nearest pixel grid point. With this, you could still use Unity's built-in editor and only have to put the points at the approximate positions.
– Cherno