Search Unity

mesh disappears when close to camera . - help

Discussion in 'Editor & General Support' started by chiblue3D, Jan 24, 2013.

  1. chiblue3D

    chiblue3D

    Joined:
    Apr 25, 2012
    Posts:
    20
    I have 3 fps meshes loaded into unity that all work fine, last night I create a new gun and hands and imported into.my.unity project. as I was trying to position the mesh to the weapon camera, when I get close to the camera the mesh disappears completely not like a clipping issue which I have seen with the other meshes as I positioned them. but this is basically the mesh is there but too far away, I.e. the arms ends are visible, but change the z setting down by .01 and no mesh. it is still in game but cannot be seen in the camera. can anyone suggest why, like I said it is not clipping because the entire mesh is 've
    visible and then nothing... please help I.know I am doing something wrong but have no clue what...
     
  2. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    maybe you have the entire scale too big or too small so the opposite clipping plane of the one you're suspecting intersects.
     
  3. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    If the mesh is using a Skinned Mesh Renderer then the pivot point is most likely leaving the camera's view frustum and turning off the renderer at that point. To assure that this doesn't happen turn on "Update When Offscreen" in the Inspector.
     
    Warl89, Pilot_101, A_Marraff and 5 others like this.
  4. chiblue3D

    chiblue3D

    Joined:
    Apr 25, 2012
    Posts:
    20
    update when off screen did the trick, thanks for the response I did not even know this option existed until this problem. but that is what it is about learning and applying that knowledge.
     
    A_Marraff likes this.
  5. YahiaDro00

    YahiaDro00

    Joined:
    Feb 4, 2020
    Posts:
    6
    7 years later
    Thanks for the helpful information
     
  6. sj631

    sj631

    Joined:
    Dec 23, 2016
    Posts:
    22
    Thanks
     
    DSivtsov and YahiaDro00 like this.
  7. YahiaDro00

    YahiaDro00

    Joined:
    Feb 4, 2020
    Posts:
    6
    OMG
    this was helpful for me again after another year lol ,,, I was struggling with this issue again and forgot about that .
    but Thanks this time too to @sj631 for the Notification
     
    A_Marraff likes this.
  8. basharmilesteg42

    basharmilesteg42

    Joined:
    Nov 27, 2020
    Posts:
    1
    Thanks!!!
     
  9. Muzicjohn

    Muzicjohn

    Joined:
    Sep 1, 2021
    Posts:
    2
    One tip though, I just tested it:
    If you have this problem with ragdoll, so your mesh is on the move for a while and then it's static, you can enable updateWhenOffscreen just for a few seconds (or even one frame) and then set the values of the bounds permanently and disable updateWhenOffscreen.
    This way the mesh is displayed properly and you don't make the calculations every frame.
    Code (CSharp):
    1. Vector3 localCenter = renderer.localBounds.center;
    2. Vector3 localExtent = renderer.localBounds.extents;
    3. renderer.updateWhenOffscreen = false;
    4. var localBounds = renderer.localBounds;
    5. localBounds.center = localCenter;
    6. localBounds.extents = localExtent;
    7. renderer.localBounds = localBounds;
     
    Last edited: Jan 31, 2024