As my title states, is it possible to create a PolygonCollider2D and Mesh such that there is a gap or hole that is completely within the outer boundary of the shape the collider/mesh is mimicking? A simple example would be a donut/torus shape, with a circle cut out of the geometry in the middle. The boundary points have to be calculated during script startup as well.
Hi Kurt thank you for the reply but I’m not quite sure I follow. I have a rectangle around which I need to generate a set of colliders & meshes, excluding the area that the rectangle takes up along with the space taken up by each inner collider/mesh (please see the attached pic):
I need each collider & mesh to only take up the space shaded by the yellow/blue/red colors, respectively but it seems to me right now that a PolygonCollider2D can’t have any internal gaps or spaces. Is this not the case? Are you able to tell a PolygonCollider2D to ignore a region of space, thereby creating the necessary gaps?
Thanks guys for the replies - I wound up creating an inner- & outer-bounds set of points as suggested to define the shape and the PolygonCollider2D correctly interpreted my points. From there I was able to generate a set of triangles using the built-in PolygonCollider2D.CreateMesh() function - instead of the old Triangulator code - to create the mesh data and now I have a functioning set of ring meshes & colliders.