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

Resolved Can't stop mesh from disappearing on certain camera angles!

Discussion in 'Editor & General Support' started by Simplisticated_Development, Oct 1, 2023.

  1. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61
    Hey everyone.

    I recently made a rowboat mesh in Pro builder by cutting off a few of the cylinder's faces. But now, certain camera angles disable sides of my new rowboat. How do I fix this? I tried occlusion/culling settings and other suggested remedies, but nothing is working.

    Thank you!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Is this a single mesh, or multiple?

    Check the mesh boundaries. It may help to visualize it with gizmos for example. When a mesh has incorrect or zero bounds the mesh will only be visible when its pivot point is in the camera frustum.

    On the MeshFilter double-click the mesh reference to bring up its details in the inspector, including info about the mesh bounds.
     
  3. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61
    One mesh. Here is a photo from the conclusion of the steps you listed:
    Screenshot 2023-10-01 at 8.12.47 AM.png
    So this mesh has a bound of 0...what do I do now?

    Thanks!
     
  4. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61
    It seems like the camera only shows the mesh's outside, because when viewing from certain angles, the inward-facing sections of the mesh are invisible.
     
  5. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61

    Here is an example of a simple cylinder that has only half of its faces.
    Screenshot 2023-10-01 at 8.50.29 AM.png
    To be clear, there are supposed to be faces on the other side of the object, but they are invisible.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,558
    That's how it works. This is standard backface culling.

    Even if it showed you the faces, their lighting would be wrong because the normals face the other way.

    You can dupe your geometry and flip the faces yourself, the cheapest and simplest way to go.

    Fix it in Blender3D this way:

    backface_culling.png
     
  7. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61
    Thanks for your answer, Kurt Dekker.

    I am not able to use your steps as I do not have blender. This prefab was made in unity with Probuilder by removing half of a cylinder's faces (as I said above). Are there any fixes in Unity?

    Thanks!
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,558
    Yes! Go back to probuilder and either dupe and flip those faces, or else build the interior of your rowboat as you would any other interior geometry.
     
  9. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61
    Thanks! All is working now! Another solution was reversing the face's normals...
     
  10. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Btw the mesh bounds aren't zero, the size seems perfectly okay. The center can be at (0,0,0) that wouldn't be an issue, the size is what matters.