The scene in editor and in game displays just fine but the Camera Preview in editor only shows the skybox and no other game objects.
Any idea why the preview isn't rending anything?
Is the camera's properties set appropriately? Culling Mask set to Everything, FoV, Clipping planes, etc.
Do you have multiple cameras in the scene?
There's really not much info in your question, usually when an object is not visible, it's because the object has been assigned a layer that the camera is culling. Or if you have multiple cameras, you could have a camera unintentionally overriding the other cameras. You'll need to update the Depth property or disable the extra camera.
Layer is set to default, cull mask to everything, camera is in orthographic mode so no FoV. Clipping planes have been adjusted and the camera moved further/closer to objects to no effect.
This is in a fresh, new project and scene with the default camera. No other cameras on scene. Everything displays normally during play, it's only the camera preview viewport that refuses to render anything.
Are your GameObjects part of the UI? If so, you can select the Canvas and set Render Mode to Screen Space - Camera, hook up the camera reference and then set the Render Mode to World Space. That would make UI objects visible in the preview.
Though, I don't really like that solution. If it's just UI objects, I would just ignore the preview and use the rendered game window.
Only three game objects in the scene, a terrain with texture and two default untextured cubes, there are no UI game objects or a UI canvas to speak of.
I'm seeing the same thing as the OP. When I set Clear Flags for the main camera to "Don't Clear", the skybox, which was filling all of the camera preview goes away and the game objects (a plane, sphere and cube) show up, now with black everywhere the skybox used to be.
Answer by gregroberts
Jan 16 at 08:57 PM
exact same challenge here. changed camera render settings from "use graphics settings" to "legacy deferred" and now it previews like a champ.
Answer by Hags0000
Oct 04, 2016 at 05:42 PM
I had this issue as well, and there was a 2nd camera hidden in the hierarchy I didn't know existed. I removed it and it solved the problem.
Answer by Tokonawa
Jan 12 at 03:47 PM
Check out if your camera's Z position is NOT zero. Set it for example -30. It helped me.
Answer by Stash329
Feb 26 at 07:13 PM
Try checking if your Depth value in the camera is set to > 0
Answer by londonwill
Apr 19 at 09:12 AM
same here. changed camera render settings from "use graphics settings" to "legacy deferred" and now it works - must be some type of minor bug in default settings
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
48 People are following this question.
Camera.Render() not working for viewport W=0.5
Finding the angle at which the edges of a camera shoot out
Camera.ViewportToWorldPoint giving different values
Find what a camera/gameobject "sees"?