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. Dismiss Notice

2D Polygon Collider on XZ plane with holes?

Discussion in 'Physics for ECS' started by TheCelt, Jul 2, 2021.

  1. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    721
    Hello

    In 2D Physics we have a 2D polygon collider where we can create holes in them by setting cycles.

    Can we please have such a feature for DOTS physics as well as I need to create polygons with holes in them and i can't use the 2D polygon collider setup since thats locked to the XY plane anyway and not part of DOTS physics.
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    I don't understand what you need. A MeshCollider can be any shape you like if you give it the right verts and faces.
     
  3. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    721
    The mesh collider doesn't have a mesh creation function like the 2D polygon collider does. I use the 2D polygon collider to generate a mesh.

    It annoys the heck out of me that such a thing is available to a 2D polygon collider and not just available separately.
     
  4. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
  5. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    721
  6. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    There is a CreateRenderMeshFromCollider function in SceneCreationSystem.cs which hijacks one of the DebugDraw functions. It's not fast but it might suit your needs.