Search Unity

Polygon Collider 2D for collision masks

Discussion in '2D' started by Hindi, Oct 11, 2015.

  1. Hindi

    Hindi

    Joined:
    Apr 14, 2013
    Posts:
    59
    Hi,

    I'd like to allow the artists to provide the collision maps as an image and I'd like to avoid implementing an edge detection algorithm. The Polygon Collider 2D seems to be what I need, but does not completely fit for a fully automated build pipeline (it seems to require manual intervention). Here is an example of a very simple collision map that could be used and the result when a Polygon Collider 2D is attached.

    I'm not sure about where the problem comes from, but I'm open to any solution as far as it doesn't require any manual intervention to edit the colliders. Also, the exemple shows rectangular shapes, but the actual maps could be made of "any" shape (even if collisions become approximative).

    Thank you for your help !
     

    Attached Files:

  2. Hindi

    Hindi

    Joined:
    Apr 14, 2013
    Posts:
    59