- Home /
New Unity GUI has messed up the scene camera
I added a GUI panel, and changed it to Screen Space - Camera, now the scene camera starts making things invisible when I get within about 10 meters of them. Here is a screenshot:
What should I do to fix this?
Answer by Bentoon · Oct 05, 2014 at 05:18 PM
it looks like the clipping plane in the Camera / or possibly that the new GUI's Rect is visible in scene view but not during play - hard to tell from the shot
~be
try setting the near clipping plane to 0 or as close as it will let it go
@StianC: The screenshot shows the SceneView, not the GameView. You can't set the clipplanes of the SceneView camera :)
Also you can't set the near clipping plane to 0. It always has to be greater than 0. Otherwise you would project the whole scene to the same point. Actually you can't calculate the projection matrix with a near clipping plane of 0 since it's calculated like this. If Zn is 0 you would set everything to 0 except the z axis
Answer by Bunny83 · Nov 05, 2014 at 11:34 PM
The SceneView camera works as both, a FPS camera and an orbitting camera. For this purpose there's a hidden pivot point in the front of your SceneView camera. If you move around (with right mouse button + W A S D ) you move the pivot with you at a constant distance in front of you. On the other hand when holding ALT down and use the left mouse button you can orbit around that point. When you use your mouse wheel you actually change the distance to the pivot. Depending on the distance from the pivot the FOV of the SceneView camera is modified.
Try to selet a Gameobject in the hierarchy, mouse your mouse over the SceneView and press "f". That will refocus the camera on that gameobject. It places the cameras pivot on the target object and tries to find a distance / FOV so the object is fully viewed.
Some time ago i've created a simple editor window that will draw a small cube at the SceneView's pivot point. Just try it. With that cube visible it's way easier to switch between FPS and orbit mode.
btw: If you create a new GameObject it will be placed at this pivot point.