So, I have a 3D game, with a bunch of 2D objects on different planes, and I swear, the camera is bugging out, and I have no idea how to fix it.
Basically, everything is visible, and then I’ll add another game object within the camera’s view, and half my objects disappear, if I remove it, everything looks fine again. You know in microsoft word when all you want to do is add a picture and the whole document gets rearranged? It’s kind of like that - and just as annoying.
I’ve fiddled with the depth and clipping plain fields but haven’t got anywhere. I’m working on uploading some screenshots that describe this better, but I’m pretty sure this is a Unity problem? If i use the scene view’s 3d camera at an angle, I can see everything, then when I switch to 2D half the UI disappears?
If anyone’s had a similar problem please speak up!
Thanks,
Fred T.A
EDIT: Images are below - sorry that I couldn’t get actual images inserted, you’ll have to follow the imgur links:
Scene view 3D, from the right
Scene view 3D, from the left
Scene view 2D, notice the text on the left is missing
Been messing about with this trying to fix it but just seem to be making things worse, now all text in my scene displays as black, even though I’ve set the colour to red/white
Yep, messed around with all the Z-coords, doesn’t seem to be the problem because even the camera (Unity’s camera not the one I have made) in that provides the view in the scene view seems to be bugging out, as I pan around the scene things disappear and reappear - very frustrating
Okay, don’t know if this confirms that it’s a render order problem or not, but after playing around with the Z values some more, and positioning the objects in a way that doesn’t look like should work at all, I can see everything being displayed clearly. However the moment I create a new gameobject or even change the parent of a gameobject, everything disappears again. Screenshots here:
I’m using a worldspace canvas, that covers the entire scene, and multiple gameobjects acting has folders for UI elements in different areas, EG the CLI on the right of the screen and the clock at the top of the screen.
Edit: Changing the camera’s opaque/transparent render mode did not have any apparent effect.
Okay, making some progress now, before I had EVERYTHING that I wanted overlay ed over the moving game objects in a single canvas, now I have three canvases each with a different sorting layer, only a few issues now, but they might prove to be unrelated to the render order…
All fixed now, didn’t realize each canvas had its own sorting layer, I only had one canvas with a bunch of elements at different depths and they were all fighting to be rendered first, I assume that’s what was causing the inconsistency in the render order. Thanks for the help mikael_juhala, probably wouldn’t have figured it out if you hadn’t asked how I had my canvas set up