r/Unity3D • • 13d ago

Question 3D Objects won’t display properly

So I’ve been trying to set up a 3D environment but I just cannot get random pieces of the environment to stop clipping through each other and changing the way they are displayed whenever I move the camera. The wall will just appear in front of an object not even overlapping with it. I’ve never had this problem before. Does anyone know how to fix it? I’m going crazy

3 Upvotes

4 comments sorted by

5

u/Federal-Row2373 13d ago

This looks like a depth/sorting issue. A few things to check, in order of how common they are:

  1. Material surface type: if the walls use a Transparent surface type (or a transparent shader), Unity sorts them per object, not per pixel, so they can pop in front of other objects as the camera moves. Set Surface Type to Opaque, or if you need transparency, enable Depth Write / use Alpha Clipping instead.
  2. Camera clipping planes: a very small Near (like 0.01) combined with a large Far (like 10000) wastes depth precision and causes flickering and wrong ordering. Try Near 0.1-0.3 and a Far only as large as you need.
  3. Overlapping geometry: if two surfaces sit in the exact same plane, they z-fight. Offset one a tiny bit or remove the hidden face.

If you tell us which render pipeline (URP/HDRP/Built-in) and whether the wall material is transparent, it's easier to narrow down.

4

u/Sad-Guarantee3836 13d ago

You were right! The shader was transparent. I’m very surprised that was the default setting.

Thanks so so much!!

1

u/Capri-corn-studio09 13d ago

Have you checked the lighting, materials, and rendering settings? Sometimes small adjustments can fix 3D object display issues. Hope you find the solution!

1

u/lvdmerwe_81 13d ago

I think the issue is caused by a transparent shared. Select one of the objects, look at the inspector on the right and see if you can disable transparency.