Search code examples
c#unity-game-enginecamerascene

When re-entering the scene, writes "No Cameras rendering" in unity


When re-entering the scene, writes "No Cameras rendering". I have 2 scripts, which make the transition to another scene. There are cameras on all the scenes. Saves are not performed anywhere. When the first scene starts for the first time, it starts without any problems. Scene one:

...
bool isFirst = true;
void Update{
...
   if(isFirst){
      SceneManager.LoadScene("two");
      isFirst = false;
   }
   ...
}
...

Scene two:

...
bool isFirst = true;
void Update{
...
   if(isFirst){
      SceneManager.LoadScene("one");
      isFirst = false;
   }
   ...
}
...

And after that, "No cameras rendering" is output.

It is necessary that the action takes place on the first scene, then after its execution, the second scene starts. And then, after completing the task, the second scene would start.

P. S. recently updated Unity Hub, maybe the problem is because of this. The unity version is 2022.3.17f, WebGL.


Solution

  • I found the problem. the fact is that in the main player control script there was a page where there was a check for true. If false, the line of making the camera inactive was executed.