Search Unity

Dirty mesh?

Discussion in 'World Building' started by SgtLame, Aug 31, 2021.

  1. SgtLame

    SgtLame

    Joined:
    Nov 26, 2015
    Posts:
    129
    Hi,
    I'm using the ProBuilder API to build custom meshes. Below is the example I'm working on:

    upload_2021-8-31_15-52-26.png

    As you can see, the selected face is an "inner" face of the surrounding face, which is:

    upload_2021-8-31_15-53-16.png

    Problem is I can't extrude the inner face: when I extrude, it just moves and pulls the surrounding face, as if I was just moving the Z direction gizmo:

    upload_2021-8-31_15-55-11.png

    When I debug through C# and look through all the ProBuilderMesh properties, everything looks fine: vertices, faces, etc.

    I tried doing it on a mesh I built through ProBuilder interface, and it works.

    So there is obviously something dirty in the way I build the mesh with the API, and I can't find what it is. I'm really stuck and help would be greatly greatly appreciated! I uploaded a package of the mesh if anyone wants to take a look.
     

    Attached Files:

  2. SgtLame

    SgtLame

    Joined:
    Nov 26, 2015
    Posts:
    129
    Ok I found what was wrong: In order to be extruded, a face needs to have its own vertices, while the surrounding face uses a copy of those vertices. The sharedVertices property then matches identical vertices.
    Hope I'm making myself clear. ^^'