Superimposition fade between two scenes

I’m currently using a script that will load a random scene at the press of a button to test different methods of transitioning between scenes out and I was wondering, is there any way to fade from one scene to an other so that they superimpose for a short period before the initial scene fades out and only the new scene is left visible? Maybe something with Render Textures?

Will I have to set it so that the player is not destroyed on load and just continues over into the next scene?

Generally Unity only has one world space and can only have one level loaded at the same time. However, you actually don’t need both levels at the same time. If you have Unity pro, the easiest way is to use a RenderTexture. Just write a small script that records the last screen into a rendertexture, displays the texture fullscreen, make sure the cotaining gameobject is marked with DontDestroyOnLoad and load the new level. Now you can reduce the alpha of your texture and the new scene will fade in while the texture fades out.

Without unity pro you can take a screenshot and use it as texture. It might be a bit slower but should work as well.

If you want to be able to move around during the fading, you can also load the new scene “additively” and use two cameras, a rendertexture and place the two scenes on different layers. In this case you should organise your levels in a way so they only contain one gameobject which has the whole level content as child objects. This way you can easily delete the content of a certain level. Just use Destroy on the root object of the old level and it’s gone :wink: