in game and scene view, the planes and 3d text objects will disappear from camera when at specific angle or distance (i am unsure which is causing it). it is only the planes and 3d text specifically. I have adjusted the near and far clipping planes and it has not worked. if anybody knows how to fix it, it would be greatly appreciated.
edit: so it appears this only occurs when another plane (such as the floor) is directly below it. There is no code attached to the planes, and this occurs for every single one.
this is what the error appears like: (the gizmo icon shows where text should be appearing)
edit 2: I have solved the issue. The bug was that the sorting order was the same as the ground below it. Thank you to everyone for helping me with this.
Generally if you look at the backside of geometry, you see nothing.
Is that what is happening? If so, dupe the geometry or flip it around.
If not, then it just sounds like you wrote a bug… and that means… time to start debugging!
By debugging you can find out exactly what your program is doing so you can fix it.
Use the above techniques to get the information you need in order to reason about what the problem is.
You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.
Once you understand what the problem is, you may begin to reason about a solution to the problem.
Remember with Unity the code is only a tiny fraction of the problem space. Everything asset- and scene- wise must also be set up correctly to match the associated code and its assumptions.
If you reach a point where things are still relentlessly mysterious, try this template:
How to report your problem productively in the Unity3D forums:
This is the bare minimum of information to report:
what you want
what you tried
what you expected to happen
what actually happened, log output, variable values, and especially any errors you see
links to actual Unity3D documentation you used to cross-check your work (CRITICAL!!!)
The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?
If you post code, only post the relevant code and always use the format button above. Do not post photographs of code.
Remember, we are not here to do your work! You are going to do your work yourself, perhaps based on our answers to your questions. Therefore it is of critical importance that you ask the question well if you want useful answers.
Three (3) primary ways that Unity draws / stacks / sorts / layers / overlays stuff:
In short, as far as the Standard Rendering Pipeline,
The default 3D Renderers draw stuff according to Z depth - distance from camera.
SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties
UI Canvas Renderers draw in linear transform sequence, like a stack of papers
If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:
identify what you are using
search online for the combination of things you are doing and how to to achieve what you want.
There may be more than one solution to try.
For instance, you may even use multiple co-located cameras (along with different Layers and LayerMasks drawn to different-depth Cameras) to more-explicitly control apparent draw ordering.
Additional reading in the official docs:
And SortingGroups can also be extremely helpful in certain circumstances:
Other rendering pipelines may have other ways of layering (HDRP and URP). Go see the latest docs for details.
There’s lots of third party open source packages available as well, such as this: