- Home /
Making 2D Tilemap Colliders fit shape perfectly.
So, I'm working on a little 2d platformer game, one of my first times using Unity, and I made a bunch of tilemaps for art in the game. One of my tiles is a stair, and when I put the 2D Tilemap component on the tile layer, instead of fitting the stair shape it makes a weird cut-corner square shape. Because this makes that side of the tile over half a unit tall, it means the player has to jump up it, which rather defeats the purpose of having stairs.
Is there a way to make the collider not do this? If not, is there some workaround? If it changes the answer, I'm using Unity 2018.3. Apologies if this has been asked before, but I didn't see anything that helped. Thanks in advance.
Answer by AaronBacon · Nov 26, 2020 at 03:29 AM
Yep, thats to do with the sprite setup. By default Unity makes rough collision, to edit it, you want to find the image file in the project view and click Sprite Editor. Then, on the drop down on the Top left, select Custom Physics Shape. From there, click on any sprite in the tileset and edit its collider by clicking and dragging.
Your answer
Follow this Question
Related Questions
Collision on specific Frames 1 Answer
Why does my OnCollisionEnter2D not work? 3 Answers
Problem with method Collider2D.isTouchingLayers() 4 Answers
Rigidbody2D.velocity out of controll 3 Answers
[c#]collision script not working 1 Answer