How to change or remove Skybox on run time in unity using C#?
Is there any way to remove it while its not even required?
Or load it using http link for material we are using in Skybox.
How to change or remove Skybox on run time in unity using C#?
Is there any way to remove it while its not even required?
Or load it using http link for material we are using in Skybox.
use this under any function if you want to remove for example in
void Update()
{ RenderSettings.skybox = (null);
or just use this RenderSetting.skybox = (null);
public material = skyboxMat;
to change skybox same RenderSetting.skybox = skyboxMat;
is being used
In addition setting the skybox globally with RenderSettings.skybox = newMaterial
, you can also set a skybox on the camera-level. This can be useful when you want to have different cameras with different skyboxes.
GetComponent<Skybox>().material = newMaterial