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.