Canvas is hiding my 3D model, can I place the model in front of the canvas?
Asked Answered
F

2

0

So I have a Canvas with several elements on it and a 3D model (robot) which is not part of the canvas.

There is one camera in the scene so far and it is pointing at the robot. So when I run the game, it looks something like this (I have replaced the actual model with Unity objects for now):

The canvas render mode is set to “Screen Space - Overlay”.

Here’s the problem, I am using a panel for the background and its alpha is set to 0 which is why you can see the model in the picture. However, as soon as I add a background, the model disappears and sits behind the canvas like in this picture

So now I am wondering if I should be using a second camera or if there is a way around it.

What do you guys think?

Fineness answered 16/1, 2024 at 12:41 Comment(1)

Ok ty Works fine now :)

Phlogistic
V
0

In situations like this I like to use multiple cameras to separate the layers of what we can see.
For this I would use 1 camera for the UI and 1 for the model and controls the background.

Another option is to use a third camera for the background in case you want to add things that can only be seen in the background and can mean you can change the background to what you like without effecting the model or UI.

Verse answered 16/1, 2024 at 12:32 Comment(1)

Thank you for the reply. Quick question, what do you mean when you saud "and controls the background"? Another thing, the main camera is assigned to the robot and the new camera is assigned to the Canvas. How do you blend both worlds together in this case? Do you have to control the depth of the cameras? Are there layers I need to switch on/off? A hierarchy of some sort? Thanks again!

Fineness
T
0

Use 2 canvases, one for UI (Screen Space - Overlay) 2nd for the background (Screen Space - Camera), and set plane distances for 2nd that you need for good looking.

Turgot answered 16/1, 2024 at 12:36 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.