- Home /
Scene Is Missing A Full Screen Camera?
OK I'm using this method here for switching cameras from one UI canvas to another. Switching Cameras method UI C#
Only when I switch to the 2nd camera on the 2nd canvas I get this:
It turns out that my camera was accidentally made a child of the canvas. But even when I removed it from the canvas I still get only a black screen on camera switch?
Both canvases are set as camera screen space and have the correct cameras assigned to them? What could be wrong? Anyone?
Answer by Maulwurfmann · Feb 21, 2016 at 04:27 PM
Check if the "Viewport Rect" of your Camera is setup correctly: X:0 Y:0 W:1 H:1
Answer by VengadoraVG · Mar 21, 2016 at 09:55 AM
It didn't work for me! I could not fix it in any way...
I ended up setting up the main camera's transform position and rotation to the "camera i wanted to switch to"'s position and rotation :(
void Start () {
// ...
_originalCameraRotation = _mainCamera.transform.rotation;
_originalCameraPosition = _mainCamera.transform.position;
// ...
}
void SwitchToCamera(Camera c) {
_mainCamera.transform.position = c.transform.position;
_mainCamera.transform.rotation = c.transform.rotation;
}
void ReturnToMainCamera () {
_mainCamera.transform.position = _originalCameraPosition;
_mainCamera.transform.rotation= _originalCameraRotation;
}
Just tag every camera you are trying to switch to/from as $$anonymous$$ainCamera then use SetActive to enable and disable whichever camera you want.
Run your game in the editor. Check the scene elements in the Hierarchy. If there is no camera whose viewport width and height (both) is set to 1, Unity displays this error.
Your answer
Follow this Question
Related Questions
Is there a way to make a Texture2D screenshot that ignores the canvas? 3 Answers
UI Minimap 0 Answers
canvas screen space camera rotation issue 0 Answers