Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mesh/GameObject disappears at certain camera angles

Discussion in 'General Graphics' started by Markus013, Apr 5, 2016.

  1. Markus013

    Markus013

    Joined:
    Jan 4, 2016
    Posts:
    2
    This is a screen cap of my issue: <bad link removed by moderator>

    essentially at certain angles the hand/arms models just disappear. they are in a gameobject directly attached to the main Camera.

    Just using the unity asset pack first person controller right now.

    the arms seem fine in the Scene view, but are flickering in the Game view. I have tried playing around with the directional light, and I don't believe (?) lighting is the issue.

    I'm pretty new in regards to using models/meshes so I'm not sure if there's something glaringly obvious I missed.

    and apologies, I tried searching but maybe I suck at naming the terms.
     
    Last edited by a moderator: Nov 15, 2022
    goldcloud144 likes this.
  2. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    I had a similar problem before, where a mesh that had it's pivot far away from the vertices would disappear once the pivot was out of the camera's frustrum.
     
  3. Markus013

    Markus013

    Joined:
    Jan 4, 2016
    Posts:
    2
    @Cherno Thanks, that was actually enough for me to go off of.
    I changed the way I was initially rotating the arms by rotating a parent object instead and the result seem much better

    Cheers :)
     
  4. Spickes

    Spickes

    Joined:
    Aug 14, 2016
    Posts:
    3
    In order someone will find this in the future I leave it here when this happened you went to, your mesh which is flickering look in the inspector under skinned mesh Renderer and check the "Update when offscreen" that should solve the problem
     
  5. MaxIzrinCubeUX

    MaxIzrinCubeUX

    Joined:
    Jan 13, 2020
    Posts:
    5
    Occlusion Culling can also cause this.
    I had a UI vanish when I tilt my head down below 60° in a VR project.
    Turning off the occlusion culling on the UI camera fixed it.
     
    doom0479 and goldcloud144 like this.
  6. Carterryan1990

    Carterryan1990

    Joined:
    Dec 29, 2016
    Posts:
    79
    If its a skin mesh renderer this can happen due to the meshes bounds. This can be fixed by viewing the component in the inspector and clicking the edit bounds button. You'll see in seen view there is a bounding box around the skinned object with points in the center of each of the boxes faces. Those points can be dragged outward to help with camera clipping.
     
    Nanita, ina, fairchild670 and 4 others like this.
  7. majithiaee

    majithiaee

    Joined:
    Aug 6, 2020
    Posts:
    2
    Hi! I see this post was made a long time ago, but I have the solution, please comment if you need it.
     
  8. SirBob

    SirBob

    Joined:
    Jul 13, 2014
    Posts:
    1
    What is the solution? I have a water shader in URP that will disappear at certain distances and angels.
     
  9. Tobydoo2

    Tobydoo2

    Joined:
    Oct 1, 2018
    Posts:
    3
    thankyou so, so much! ive been looking for ages and had so many problems, but this fixed them!
     
  10. Francoben

    Francoben

    Joined:
    Dec 19, 2017
    Posts:
    2
    [SOLVED]
    Hey.

    I had the same problem but I solved it by deactivating 'Dynamic Occlusion' in an additional setting from the inspector.
    I'm using Unity 2020.1.6f1
     
  11. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    79
    I'm having a similar issue as the original post with Unity 2020.3.1f1 & URP where a bunch of stuff in my scene flickers or disappears when the camera is facing certain directions. Both dynamic and static meshes. This started happening as soon as I updated my project from Unity 2019.4 to 2020.3 LTS, and no modifications were made to the scene recently.

    ^This does stop the mesh from flickering, but what if I want to use dynamic occlusion? This isn't really a solution.
     
  12. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    79
    edd95al and goldcloud144 like this.
  13. Coimbra79

    Coimbra79

    Joined:
    Oct 26, 2015
    Posts:
    2
    If your mesh uses skinned features, so be sure to edit correctly the bounding box into inspector skinned mesh renderer properties. For optimization i humbly suggest to not update them when offscreen.
    Have a good live!
     
    Foreman_Dev likes this.
  14. teamsfestudiosinc

    teamsfestudiosinc

    Joined:
    Aug 28, 2020
    Posts:
    1
    solo arregla los "bounds" en el el mesh rendered, muy posiblemente este en 0 o fuera del área de la cámara.
     
  15. clemAlbRiz

    clemAlbRiz

    Joined:
    Jan 6, 2022
    Posts:
    1
    I had this problem on a mesh generated by code. I solved it by applying the below lines of code to associate the generated mesh.


    Code (CSharp):
    1. public void SetGameObjectMesh(GameObject go, Mesh mesh)
    2.     {
    3.         go.GetComponent<MeshFilter>().sharedMesh = mesh;
    4.         go.GetComponent<MeshFilter().sharedMesh.RecalculateBounds();
    5.         go.GetComponent<MeshFilter().sharedMesh.RecalculateNormals();
    6.     }
     
    niwhocug, ATMLVE, mathewr321 and 4 others like this.
  16. mrVentures

    mrVentures

    Joined:
    Nov 11, 2018
    Posts:
    9
    This fixed it for me, thanks clemSUM. I have to call it everytime I update the mesh.
     
  17. goldcloud144

    goldcloud144

    Joined:
    Jun 20, 2020
    Posts:
    9
    I face the issue because of the materials were "Transparent". Another option to consider.
     
  18. constantinpopp

    constantinpopp

    Joined:
    Jul 21, 2017
    Posts:
    5
    It could also be that the occlusion data is out of data. I encountered the issue when I had moved objects to new positions but did not update the baked occlusion data (Window->Rendering->Occlusion Culling). Hence objects disappeared at random camera angles. Just clear the baked data or re-bake.
     
  19. rookcorvus03

    rookcorvus03

    Joined:
    Aug 6, 2022
    Posts:
    1
    EASY FIX!

    For me I just checkmarked (Static) box in the top right and it fixed the issue.
     
  20. MichaelEGA

    MichaelEGA

    Joined:
    Oct 11, 2019
    Posts:
    39
    I currently have a version of this problem in 2022.2...
    • It's not a clipping issue, my camera is set to 0.1 and the far clip to 90000. Lowering the farclip to 10000 or even 5000 does not solve the issue.
    • It has nothing to do with occlusion culling, the problem occurs whether this is set or not.
    • It has nothing to do with dynamic occlusion culling, the problem occurs whether this is set or not.
    • I have not set any custom render bounds, or modified any meshes... everything is default
    • It has nothing to do with whether the object is static or not. This does not change the outcome.
    None of the above fixes work. :(

    https://answers.unity.com/questions/1933778/meshes-disappearing-at-edge-of-screen.html

    EDIT [SOLVED]: For anyone with a similar problem to mine. It's a bug, the camera is broken, possibly by putting in clipping values that are too small or too big (or both). The solution was to delete and remake the camera. As described here: https://forum.unity.com/threads/solved-screen-position-out-of-view-frustum.60851/page-2#post-8691885
     
    Last edited: Dec 29, 2022
  21. rayanjawahir25

    rayanjawahir25

    Joined:
    May 13, 2023
    Posts:
    1
  22. DamTown

    DamTown

    Joined:
    Jan 29, 2021
    Posts:
    1
    thanks, bro for your advice it worked I was on it for straight 3 hrs
     
  23. ItIsDanDev

    ItIsDanDev

    Joined:
    Jan 8, 2021
    Posts:
    4
    TYSM!! Thank you! This is a very easy fix that I have been having issues with.
    :D:D:):)
     
  24. Gubity_Studio

    Gubity_Studio

    Joined:
    May 1, 2022
    Posts:
    6
    Thank you so much mate, your comment saved my time.