Canvas without Camera?
What happens if i use Canvas without Camera? Does it really makes any kind of difference.
For Example, one of my friend's just made a game. Its completely 2D game and is Canvas based but he didn't use ant camera. I have been working on unity for a few years now but haven't done anything like this i.e. making a game without camera. His game is working fine though but am still not sure. I have doubts that something is wrong.
Please Help,
Thanks in Advance
Answer by HarshadK · May 24, 2016 at 01:57 PM
You need to have at least one camera in the scene in order for scene to render. I think he has used Screen Space - Overlay mode for the canvas which uses the Main Camera from the scene itself to render.
Yes, that's screen space. But it doesn't use the mainCamera. Screen space uses an invisible perfectly flat (orthogonal) camera. You can think of it as a shortcut for Camera-Space, where you tell the system "I'm not going to be doing any perspective or size tricks, so just make a standard UI camera for me."
The trick is to have the menu cover every pixel on the entire screen. That way it doesn't matter that you don't have a mainCamera.
I was actually under the impression that since Screen Space does not take camera as input it is accessing and using the $$anonymous$$ain Camera to render. Thanks for sharing this. :-)
Answer by binarybehemoth · May 24, 2016 at 02:22 PM
On the canvas, just change Render Mode to "Screen Space - Overlay", and you can do away with any camera.
Here are more details: