Examples or resources for using a scene as overlay?

Going from this topic I am trying to figure out how to separate my in-game UI from the rest and then overlay that scene over the rest of the game.

Is there any sample code or documentation on how to best achieve this?
I’m struggling to get the rendering correct as I don’t really understand what I have to do in the parent scene’s render component.

Hi, @BorisCallens,

It is possible to create a child scene component in your main scene, which allows you to reference another scene (where you have your UI set up). In the main scene’s settings you will also have to add a “Render Child Scene” renderer, possibly after your Clear Renderframe and Render Camera renderers. You might also want to add another Clear Render frame between them and set it to clear only the depth, so avoid clipping and pop-ups.

In short:

  1. Create two scenes, Main and UI. Set up your world in Main and your UI components in UI.
  2. In your Main scene create a new Entity with the Child scene component. Select the UI scene as a reference.
  3. In your Main scene’s Scene settings, add a new renderer in Renderers, after Clear Frame and Render Camera. Make the new renderer Render Child Scene and pick up the entity you created in 2.

Please note that this process might change in the future. We want to simplify it a bit, but for now this is how it can be done.

1 Like

Great thanks,
I figured out the child scene thing, but couldn’t get the camera working.
Will try as soon as possible.