Search Unity

Tilemap Collider 2D is too big for the sprites

Discussion in '2D' started by DioricaVancila, Nov 12, 2019.

  1. DioricaVancila

    DioricaVancila

    Joined:
    Jul 17, 2019
    Posts:
    3
    Hi, in the image you can see the tilemap on which I've placed my walls, which I want the player to collide with. I added a Tilemap Collider 2D to it, but it's way too wide. I've tried messing with the values of the component but to no result. All the tiles have their Collider Type set to Sprite. How do I fix this? Placing individual Box Colliders would take way too much work.
    Thanks.

    Unity Forum 1.png Unity Forum 2.png
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    You can edit the physics shape of each sprite in the unity sprite editor. There's a dropdown at the top left corner to select physics shape and create a custom shape.
     
    vakabaka and DioricaVancila like this.
  3. DioricaVancila

    DioricaVancila

    Joined:
    Jul 17, 2019
    Posts:
    3
    Thanks so much jeffreyschoch, it fixed the issue!
     
    LiterallyJeff likes this.
  4. LukasSacher

    LukasSacher

    Joined:
    May 2, 2019
    Posts:
    15
    Thanks helped me too