Search Unity

2D Polygon in Unity Editor

Discussion in '2D' started by ognale88, Jul 17, 2018.

  1. ognale88

    ognale88

    Joined:
    Apr 16, 2018
    Posts:
    1
    Hi Guys,

    As I was new to Unity Development, I would like to draw polygons over a Raw Image. I have tried Line Renderer, 2D Polygon Collider. But these thing is not working for me. Since I need to draw some 2D polygons and to give color via script, I could achieve it. Suggestions appreciated.

    Thanks in advance.
     
  2. turp182

    turp182

    Joined:
    May 3, 2018
    Posts:
    52
    Polygon Collider 2D - you didn't mention 2D, just checking - isn't working? It wraps my sprites rather perfectly (Image #1). And if you wan to change it, click the Edit Collier button at the top of the Collider component section and grab the outside line (Image #2).

    Here's some additional info about the 2D colliders and performance as well:
    https://forum.unity.com/threads/edge-collider-vs-box-collider-vs-polygon-collider.229166/

    Image #1 - Default Polygon Collider 2D:
    upload_2018-7-17_18-33-22.png

    Image #2 - Edited Polygon Collider 2D:
    upload_2018-7-17_18-34-6.png

    turp182