Search Unity

Slicing of PolygonColider2D

Discussion in '2D' started by milanhenkrich, Nov 4, 2019.

  1. milanhenkrich

    milanhenkrich

    Joined:
    Jul 26, 2018
    Posts:
    31
    Hey Guys,

    I spent hours thinking about this one!
    I am trying to copy and then slice polygon collider2D.
    On the left I have my game object, with sprite renderer and polygon collider.
    I take this sprite renderer, I "slice" it to triangles and then I create multiple game objects with mesh renderers (see right).
    My problem is, how can I create sliced versions of the very same polygon collider from previous sprite renderer?

    Do you know about some algorithm which one can do it?
    Screenshot 2019-11-04 at 19.17.24.png

    Thank you very much for any kind of support.
     
    Last edited: Nov 4, 2019