Okay, what I want to do is fade from a night skybox to a day skybox upon the sun’s rotation becoming in-between 0 and 90. I have done this fine for when it fades from a day to a night skybox, but for some reason when I want to change from night to day it just pops instantly in, without fading. Could I please have some help as to solving this issue? I am using the Skybox Blend shader.
(The top if statement is day to night, the bottom one is night to day; the one I need help with.)
if(sunRotation <= 360 && sunRotation >= 270){
var blendAmount : float = timeOfDay * 0.5;
RenderSettings.skybox.SetFloat("_Blend", blendAmount);
}
if(sunRotation >= 0 && sunRotation <= 90){
var blendAmount1 : float = timeOfDay * 0.5;
if(blendAmount1 < 0){
blendAmount1 = 0;
}
RenderSettings.skybox.SetFloat("_Blend", -blendAmount1);
}