Objects Disappearing?

I’ve got an issue where objects will disappear when they’re directly in front of the camera. I’m wondering if anyone else has experienced this and if they know what causes it.

A few details:

  1. Some objects directly in front of the camera will disappear. The object will reappear when it’s closer to the edge of the screen.
  2. This happens for up close objects and far away objects.
  3. Sometimes it will only affect the LOD1 of a group, so moving closer will show the LOD0 as normal.
  4. It also affects objects without an LOD group.
  5. I had previously baked occlusion and then deleted the baked data (not sure if that’s related).

Anyone experienced this?

First guess: The transform of one of your LODs is not correct (the position != 0). Make sure you haven’t accidentally moved an LOD rather than the group.

As for objects that are not LOD’ed, it does sound like bad occlusion data. You sure you cleared out that baked data properly?

First guess is the near clipping plane of the camera - have a look at that. Maybe it’s too far away?

2 Likes

Thanks both.

The first issue turned out to be something pretty boneheaded. Somehow the LOD1 meshes got deleted from the group.

As for the other issue:

  1. I did check the camera clipping planes and they’re set to sane values.
  2. I cleared the static/occlusion flags off of the objects (no change).
  3. I triple-checked that the occlusion data is gone and it says it is.

Do you two or anyone else know if it’s possible to manually remove occlusion data (maybe it’s not really gone?) or somehow reset the scene in Unity?

Solved it and wanted to post here in case anyone encounters this.

I had been setting individual culling distances via script. I updated my layer ordering and then removed the script that updated the culling distances. That seems to have corrupted that data somehow – and those distances don’t appear to reset themselves when play mode is exited, or at least they didn’t in this case.

I loaded a zeroed array to layerCullDistances and that fixed the problem.

2 Likes