Hello,
I’m making a unity game and i want to know how can i change the skybox pressing a button
I have already a script found in the older versions of unity, but in unity 5.5 it gives me error on " : " in the var sky material
Using unity.engine
Using unity.collections ... i'm on a smartphone ...
But the main script is:
var sky1 : Material;
var sky2 : Material;
var sky3 : Material;
function OnGUI () {
if(GUILayout.Button ("Sky 1"))
{
RenderSettings.skybox = sky1;
}
if(GUILayout.Button ("Sky 2"))
{
RenderSettings.skybox = sky2;
}
if(GUILayout.Button ("Sky 3"))
{
RenderSettings.skybox = sky3;
}
}
How can i fix that ?
Or Does anyone knows another script that can change sky on click ?