Editing the Unity Tilemap Collider 2D Box

Unity 2017.20.0 Beta shipped with a new tile map editor built in. This is great for quickly creating maps that would otherwise take too long to position manually or are simple enough they don't require a programmatic solution.

Normally tiles are square or rectangular and adding a Tilemap Collider box fits them naturally.

Tile Maps are a new component in Unity and can be added via the dropdown menu. Here i'm using for a 2D platformer scene.

Unfortunately for sprites that are uneven, the box collider can try too hard to fit the boundaries and break platforms / hit detection for characters.

To fix this, just go the sprite editor in the sprite you’re trying to use and select Edit Physics Shape from the to left dropdown. You can delete points by pressing CMD + Delete on OSX.

Make sure to hit reset on your Tile Map Collider component.

And that's it – the box collider should update to reflect the edited physics shape!