Collider questions regarding "exactness" and automation

Hi guys, I have seen examples of maps imported to Unity with tiled2unity and the collisions are worked out to use the least amount of polygon points. I am testing to see if tiled2unity is the way forward and everything seems great except I am struggling with collisions (as below):

So it’s probably quite obvious what I have done… I have gone to “view” => “tile collision editor” and selected each one individually and drawn a collision box around it, and used the polygon tool for the slopes. As I was doing it I thought… “this is gonna cause some issues with lining it all up because there is no ‘snaping’ to pixels etc…”. The tile sizes are only 8px by 8px so that may be an issue… but it would seem you have to be very precise to get it perfect.

Is there any automation or more “exact” way of doing this? Seems I’ve gone about it the wrong way :frowning:

Thanks in advance for any help!

Actually, there is. If your tiles are 8x8, you can set up the “fine grid” in preferences to use 8 subdivisions, and then check “Snap to Fine Grid” in the “View” menu and things will snap to pixels. Though it seems that for your use-case, it would have been enough to just enable snapping to the tile grid since you’re only using the corners.

The next new feature release of Tiled will have an explicit “Snap to Pixels” option in the “View” menu. This is already available in the snapshot builds.

That sounds great and thanks for your help :slight_smile:

1 Like