Addictive Scene UI and Games

Hello, it’s my first time asking a question in here,
I’ve been stuck in this problem for 2 days and can’t quite figure out how I approach this.

So I tried to make 2 Addictive Scene 1 for the UI and another for In-Game like the picture below

On the cluster scene I have cinemachine for the camera, so when I click on the building the camera will focus on the building

and on the UI Scene I have the normal camera on Display 1 as well as the camera on cinemachine.

now I tried to make like this

is this kind of thing possible to do in Unity? i just want to try something new for my project.

Thanks in advance, have a great day!

Is there a reason for having two scenes? If you only want the UI to be rendered over the other scene, the solution is very easy:

You can set the Canvas to be in overlay mode. With this configuration, you set how you want for the canvas to look on your screen, you can read more here. You also don’t need another camera for this (or another scene), by default Unity will only render one camera anyway, for multiple cameras you would need a Render texture but that it’s another topic.

Thank you, just like you said all i have to do set the canvas to overlay mode and it works.

The reason I’m having 2 scenes is cause I want to experiment with it and see the result is it good to have a scene just for UI and another for 3D.? i imagine games like MOBA on android when in battle I don’t think they have 1 scene only when in battle, I believe they were having 2 scene for this.

I don’t see a reason to have a separate scene for the UI, I know that it’s a bit confusing to see the canvas over your level in the scene window, but you get used to this as time passes. Maybe have it in a prefab and load it dynamically, but having an entire scene for the UI does not really make sense in my opinion.

Additive scenes are great… I break all my games up and the UI always goes in a separate scene.

HOWEVER… now you must also abstract all inter-scene communications so they can be hooked up without dragging. Dragging is always the best way to hook stuff up in Unity, but you can’t drag across from one scene to another.

I use my Datasacks package to drive and handle UI that does not need any dragging into other parts of my games.

Another way is a simple centralized “GameManager” type of construct that all the different scenes access to learn about each other.

Here’s more reading:

Additive scene loading is one possible solution:

A multi-scene loader thingy:

My typical Scene Loader:

Other notes on additive scene loading:

Timing of scene loading:

Also, if something exists only once in one scene, DO NOT MAKE A PREFAB out of it. It’s a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

Two similar examples of checking if everything is ready to go:

Wow, thank you for the details, For now, I centralized my data using GameManager and just hardcoded it for today.

I read the Datasacks a long time ago but to be honest, never use it hehe I still use normal SO. definitely gotta try it tomorrow.

1 Like