- Home /
How do you use a camera from another scene on your skybox?
How do you use a camera from another scene on a skybox in the current scene? I want to have a camera in another scene that players will walk past and see it on the skybox in the admin area I am making in my game.
Answer by Tomer-Barkan · Dec 10, 2013 at 01:10 PM
You can't use a camera of another scene as skybox, because the other scene is not loaded in memory, hence you can't render the camera.
There are two ways I can recommend though:
Before leaving the scene that you want to be displayed in the other scene, create a screenshot of the scene and save it as a temporary file. Then in the second scene, load the file and display it as skybox.
You can have both cameras in one scene, except that each camera's layer mask only shows the objects that are relevant to it. Then when you want to show one of them as skybox, simply make sure it renders first, and the second camera's clear flags are set to depth. It will draw the second camera on top of the first camera.
How can I keep the scene alive than? $$anonymous$$y goal is an $$anonymous$$$$anonymous$$O btw. I don't know if that makes a difference.
Option 2 in my answer. Don't switch to another scene, keep both content in one scene, simply switch on/off the relevant cameras and filter which objects each camera shows using layers. As soon as you load another scene the old scene gets removed from memory.