Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Composite Collider doesn't composite correctly

Discussion in '2D' started by ChrisTobiS, Nov 10, 2017.

  1. ChrisTobiS

    ChrisTobiS

    Joined:
    Jun 15, 2017
    Posts:
    13
    I've recently started to use the new tilemap system for my 2D game and I'm trying to create colliders with tilemaps but the Composite Collider doesn't always work as I expected (I guess this is a bug).
    Here's a picture of the problem:

    CompCollideError.jpg

    This only seems to happen with sprites where the physics shape doesn't cover the whole square.
    And it looks like it has something to do with the rotation of the tile. When I don't rotate the tile this doesn't happen. Only if I rotate the tile it creates these errors, even if I rotate it back to the original position.

    There are 8 collider-and composite paths in the Composite Collider. I just repainted the exact same shape with the same tiles and now there are 17 paths. Even if I delete the Composite component and re-add it, it's a different result. So it's confusingly random.

    Does anybody have the same problem or knows how to fix it (or is it a Unity bug)?