- Home /
Orthographic camera's child is not showing up in camera preview or game view
I'm trying to make my own GUI-System with an orthographic cam, separate from the perspective cam that displays the rest of the scene. I followed the steps that @equalsequals mentioned in the answer to "Custom GUI System RenderTexture (Ortographic Cam) vs Perspective" but I'm running into a problem where I can't see the object that the orthographic camera is supposed to show.
I created a simple project to test this, where the sphere is parented to the orthographic camera and in a separate TestLayer. I noticed that my Orthographic Camera preview is dark and and doesn't show the sphere, but I know the orthocam or sphere is in the frustrum because the green outline appears in the frustrum when I select the sphere in the hierarchy.
These are my settings:
@equalsequals Would you happen to know what the problem is? I believe I followed the steps you enumerated in your answer to "Custom GUI System RenderTexture (Ortographic Cam) vs Perspective"
Answer by Professor Snake · Apr 02, 2013 at 07:22 AM
Change your culling mask from testlayer to everything, or tag the sphere as testlayer.
For changing the culling mask from testlayer to everything, wouldn't that mean the orthographic camera would render everything? I only want the sphere to be rendered in the orthographic view, and the cube to be rendered in the perspective view. All the other instructions I've read said that the culling mask should be set to the layer you want to render.
As for the second suggestion, I didn't see an option to tag the sphere as testlayer. I only see the option to make that the layer, which it currently is. When I click on "tag", I get a dropdown list of items, but no option to select testlayer. If I click "Add Tag", it takes me to the place where I created the testlayer layer and if I try to create a new tag, I don't see it in the dropdown menu next to tags.
I apologise, i meant changing its layer to testlayer. You also need to select the sphere to coorrectly change its layer, from your screenshot i see that you are selecting your camera.
Both the sphere and the orthocamera have layer set to TestLayer, but the sphere is still not showing up.
Hmm, try setting the orthographic camera's clear mode to Depth Only and change its depth so it renders on top of the other one.
Try making the orthographic size smaller, to about 10 or 20.