Search Unity

Question Clear camera at runtime

Discussion in 'General Graphics' started by kanjam, Mar 13, 2023.

  1. kanjam

    kanjam

    Joined:
    Oct 12, 2022
    Posts:
    3
    Hi, I am using multiple displays. At runtime, I want to turn off Display 2 (clear what's being shown on Display). I tried disabling the camera and changing Target Display to a different display number but Display 2 still shows the last static frame. Is there a way to make it completely turn off i.e show blank?

    Thanks
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    672
    Haven't tried it but this could work:

    camera.enabled = false;
    camera.cullingMask = 0;
    camera.clearFlags = CameraFlags.SolidColor;
    camera.backgroundColor = Color.black;
    camera.Render();