- Home /
I can't get my script to work I get an error. [Please Help!]
My script I'm making is to make it so every 90 seconds my skybox automatically changes. (Basically my own nooby Day/Night cycle.)
But I keep getting this error: BCE0023:
No appropriate version of 'UnityEngine.Object.Destroy' for the argument list '(System.Type)' was found.
Here's my script please tell me what you think.
P.S I'm a noob to scripting please no harsh words. :)
var mat1:Material;
var mat2:Material;
var timer : float = 90.0;
function Start(){
RenderSettings.skybox=mat1; } function Update() { timer -= Time.deltaTime; if(timer <= 0) { timer = 90; night = true; }
if(night == true)
{
RenderSettings.skybox=mat2;
}
if(night == true)
timer -= Time.deltaTime;
if(timer <= 0)
{
timer = 90;
day = true;
}
if(day == true)
{
RenderSettings.skybox=mat1;
}
}
Firstly: Please format your code. If you don't know how, watch the tutorial video on the right.
Secondly: It helps if you post the whole error and the script the error is actually on. Nowhere in your script do you call Destroy
, so your script does not match your error...
Your answer
Follow this Question
Related Questions
day/night cycle runs only twice 1 Answer
How to make a Day/Night Cycle? 2 Answers
Photon Day Night Cycle Unsynced 1 Answer
Blend two lightmaps for day/night cycle? (terrain) 0 Answers
Day Night Cycle Script Not Working 3 Answers