Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Issue With PolyGon Collider 2D and Circular Meshes: Feature/Bug Fix Request !

Discussion in '2D' started by SLASH24, May 19, 2015.

  1. SLASH24

    SLASH24

    Joined:
    Sep 20, 2012
    Posts:
    144
    Hello !

    I've noticed a *Blocking Issue* when working with 2d Polygon collider:
    it does not works with circular meshes like the built-in unity Cylinder ! impossible to use it.

    imagine you need to make a rounded but yet polygonal planet or object... then you're practically obliged to use CircleCollider2D !

    The Fact is that the circle collider is well rounded whereas it's impossible to get a perfectly rounded polygonal shape (except with billion of triangles), same thing append with a sprite, else you need a huge resolution (I haven't tested yet)....

    so if circle collider fails to follow the shape of your objects, then the polygon collider should helps, I think, with more precision, following the edge and general silhouette.

    What I notice: PolygonCollider2D fails at producing the polygonal circular shapes, I believe because I've tested different ways, without success ! maybe it need a bug Fix or improvement from Unity team ....

    else, can you help me: how can I do? I try to make a 2D Planet walk-able, it's not a problem if it is not perfectly rounded and rather made of noticeable polygons... all I need is a 2D collider that matches the shape of the planet ! how can I do Then?

    illustration :
    Sans titre.png

    thanks in advance ! - Your Dev, regards -
     
  2. Gardes

    Gardes

    Joined:
    Apr 7, 2015
    Posts:
    46
    What about 11 edge colliders? :D
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I don't understand what you mean. There aren't any issues making polygon colliders in the shape of whatever you want, including flat-edged circle-like shapes. You'd probably want to make it via script rather than manually creating it in the editor, since that would be easier/more precise.

    --Eric