As we start to look deeper into the Screen Space – Camera Canvas, we will see a world of opportunity to enrich our boring, flat UI (although I quite like a flat UI for many things) and make it a little more engaging.
As we delve into this, we'll first look at some very simple examples before jumping into our main demo scene in 3D.
Note
If you haven't started your project in 3D mode, then it might be worth starting a new project for this chapter in 3D mode.
It's not essential but will makes things a little easier.
As an example, we can work with the Field of View of our Render Camera to draw our UI out of the screen:
Create a
Canvas
and set the Render Mode to Screen Space – Camera.Add a new
Camera
(Layer =UI
, Clear Flags =Don't Clear
, and Field of View =1
) and name it UICamera.Set the Canvas Render Camera to the new UICamera.
Add an Image with a Button on top of it (Button as a child of the Image).
Set each element transform's Pos Z value closer to the camera (Image 0...