- Home /
Skybox disappears after I switch scene
The title says it: After I switch scenes, the skybox just disappears. But only the material I selected. The default skybox never disappears. Does anyone know what I could do?
Edit: Just saw that the directional Light wasn‘t working too.
You probably haven't add a skybox or directional light in the scene you switch to...
public Material oSkyBoxMat1; //set in Inspector by dragging a material there
RenderSettings.skybox = oSkyBoxMat1; //then do this in code run from the new scene
@rh_galaxy I‘ve added both of those game objects. The skybox is working now because I put the script on my player, so everytime the scene loads the skybox loads. But the directional light still doesn‘t load. Do I have to change something in the lighting settings? Or what do you think
Answer by TCemAlpaydin · Jul 08, 2021 at 07:19 AM
Which version of unity are you using, and is this happening inside the editor or on a standalone build? Although it'd be a very simple mistake, you can check your camera on your other scene. It may be set to display something other than a skybox on clear flags. Also make sure your lighting is built.