Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Huge no no that Unity allows, be warned !!!

Discussion in 'Editor & General Support' started by Burve, Apr 16, 2016.

  1. Burve

    Burve

    Joined:
    Feb 12, 2011
    Posts:
    139
    As I found out it seems that there is nothing stopping you to create only scene in project with no Camera in it, and depending on the platform all even might work fine.

    So, someone, thinking they are smart, might decide, that, for example, during level loading, since you are loading level and there is nothing to show, disable camera. Then he puts uGUI UI there and in Editor all looks fine, it might even look fine on some builds (mobile, PC, Xbox, etc), but then on some other builds (WiiU, 3DS) that actually relay on knowing what camera to render on what screen you are getting black screen and can't figure out what is going on. And there is nothing warning in Editor that you don't actually have missing camera.

    When you add second camera you always get that 2 audio listeners warning that need to be corrected, but nothing for no cameras is just ridiculous.

    With all random bugs Unity editor had and still having (will not even mention latest version lightmap mess that just killed them) this one is worst, because this can be done intentionally and then just wondering, why at some point on some platforms nothing work and all work on others.

    This need to be fixed ASAP, and I will be closely following my bug report 789152 about this.
     
    MrEsquire likes this.
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Nonsense, having scenes without cameras is actually desirable for instance additive loading.


    It is impossible to protect against people who aren't in control of their projects, you do expect some responsibility on the developer. The "some platforms are ok" just indicates you aren't sure of what is really happening. It will render nothing without a camera - on all platforms.

    With multi scene editing now available, it makes even less sense what you suggest. If you are encountering camera problems it's likely you're loading some scenes with cameras which don't for whatever reason get destroyed, or aren't keeping track. For example static variables persist and it's possible to mark things to not be destroyed when loading other scenes. And so on.
     
  3. Burve

    Burve

    Joined:
    Feb 12, 2011
    Posts:
    139
    I did say "only scene in project with no Camera" not "a scene in the project"

    As for every platform will give you black screen do simple example - create new project, remove camera, add UI Image, save scene and make Windows build - you will see that white Image on screen, while there is no camera in the project.

    If you want to have more fun and have Microsoft dev account and Xbox One, you can run same project on Xbox and see same white image on screen with no camera.

    Please properly read what I write about "only scene" and not just scene. you can add multiple scenes to your main and having camera in each will not end well (and you will likely get that multiple audio listeners error to indicate that something is off), but if you have single scene and you don't have camera in it there is no warning, errors, etc, all compiles and work fine (you will not see what camera must show since there is no cameras, but there is lots of everything else in you project that is not actually in 3D that will be visible on some platforms, and if you doing 2D game there is a chance you have 0 3D objects and in current system you can not have camera at all, UI will be still visible). And that was also stated in my initial post, that UI is visible, please read all carefully.

    If you don't believe me (and it seems you down), extract this to empty folder, open in Unity and make build - you will see UI Image while there is no camera in scene and not black screen.
     

    Attached Files:

  4. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    I don't see how this is a problem. Many many scenes require I don't add a camera, so a warning of any kind would annoy me. I wouldn't build out a project to a device without testing in the editor to make sure things are working to begin with, and forgetting to include a camera seems like.... well, a very incorrect workflow :p

    What specifically do you feel needs to change? I'm confused why your bothered by this? Is there a specific real world use case you can describe where a problem arises from this? One where it's not the devs fault because of improper editor testing?
     
  5. Burve

    Burve

    Joined:
    Feb 12, 2011
    Posts:
    139
    again, not every scene - only scene !!!!!

    Warning need to be shown when you have active scene that don't have camera, because depending on target platform you might see something (mainly uGUI UI) when you actually don't have camera at all.

    So such warning need to be shown at run time, like a huge watermark over whole screen, saying that Active camera is missing. There is small such warning in editor, however if you have UI element in scene it will not be displayed.

    If you don't believe me open included project, or just create new, delete camera, add UI Image element and compile - you will see that UI element while there is no camera in scene, but if you compile and test on WiiU or 3DS devkits you will not see anything (black screen) because they have multiple screens and they require cameras with specific target displays (1 and 2) to know what to display on what screen.
     
  6. Burve

    Burve

    Joined:
    Feb 12, 2011
    Posts:
    139
    Interesting, based on Artūras from Unity QA Team this is actually a feature

    My question
    His replay
    Good Work Unity, Good Work, next we need to have scripting and art optional in Unity to have more dynamic environment, maybe even Editor, who need's extra UI.
     
  7. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Haha, well. I wouldn't get too worked up over it. Ultimately it is easy to avoid this problem, even on wii u, right? I'd say just keep on developing around this "feature" and don't let it distract ya from your project!