How to hide virtual camera frustum?

I want to hide the Virtual Camera frustum gizmo, in the Scene view. Its somewhat annoying when I am editing the scene.

The frustum is this white outline that shows what the camera is seeing. It is very huge, and gets on the way.

Do you know what option should I use in the gizmos menu to only hide this outline?

Thanks!

1 Like

it is annoying, isn’t it?
[EDIT: The remainder of this reply is unnecessary. Moving the mouse to the left of the camera in the heirarchy should show a shadow of an eye button. Click on this to hide the camera in screen view and the frustrum will disappear.]

Original Reply, don't use this

It’s very hard to get rid of. In fact, the only way I’ve found to get rid of it is to either disable ALL gizmos, or disable the entire GameObject that the main Camera is sitting on…
Neither of these is desirable, as when you press play, you’re going to have an immediate problem.

What you could do is create a second GameObject (not a child of the Main camera) and add this script:

using UnityEngine;
public class GameObjectActivatorOnAwake: MonoBehaviour
{
      [SerializeField] private GameObject objectToActivate;

      public void Awake()
      {
           if(objectToActivate!=null)
           {
                objectToActivate.SetActive(true);
           }
      }
}

Then drop the Main Camera into the ObjectToActivate field.

A few caveats on this:

  • You may need to adjust the script execution order to make this first, because another script may depend on Camera.Main being valid, and will break if the MainCamera isn’t active.
  • Because the CinemachineBrain is on the Main Camera, you’ll need this camera GameObject active while you make adjustments to any virtual camera.
  • When not in play mode, the Game Scene will be black with a message that no cameras are rendering.
1 Like

To the right of the Gizmos button is an Arrow, click on it and you see a list of all the Gizmos in the scene. Find the Camera and untick the checkbox.

1 Like

image

I found this gizmo, and disabling the icon nor the checkbox disables the frustum. It just disables the camera icon

My very easy fix was to hide the Main Camera on the view, with the eye button
image

If I want this config to persist when I restart the editor, then maybe I will implement your solution @Brian_Trotter

Thanks!

1 Like

I forgot about the eye on the left of the items in the heirarchy, good find! That is, I believe, the best solution, and much better than my ad hoc fix posted above.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms