Search Unity

Bug Are convex mesh colliders broken for one-sided concave polygons?

Discussion in 'Physics' started by andyz, Jan 12, 2021.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    It seems so.
    If I have a mesh with a 1 sided concave polygon or triangles which make a wall with cut out windows, the convex mesh generated is wrong in almost random ways - may create an oversized box or just wrong geometry.

    Perhaps a mesh must be 2 sided or not paper thing to use convex collider successfully?

    Edit: it does say in the docs "A convex mesh is required by the physics engine to have a non-zero volume. Flat meshes such as quads or planes that are marked as convex will be modified by the physics engine to have a thickness (and therefore a volume) to satisfy this requirement. The thickness of the resulting mesh is proportional to its size and can be up to 0.05 of its longest dimension in the plane of the mesh."

    But it seems to not always succeed and .05 of longest dimension could be pretty big!
    Well perhaps real solution is don't expect convex meshes of flat polys to work ok!