Day/Night Skybox

I have modified a script I found, my problem with the script is that the Blend doesn’t apply probably even though the value is right, its like the Material.SetFloat(“_Blend”, Blend) Doesn’t run:

#pragma strict
	
var TOD : float;
public var sun : GameObject;
var NightAmbientLight : Color;
var DuskAmbientLight : Color;
var MorningAmbientLight : Color;
var MiddayAmbientLight : Color;
var SunNight : Color;
var SunDay : Color;

var NightSkyBox : Material;
var DaySkyBox : Material;
var NightBlendSkybox : Material;
var DayBlendSkybox : Material;

private var skybox : Skybox;

// Use this for initialization
function Start() {
	skybox = GetComponent(Skybox);
	sun = GameObject.Instantiate(sun, Vector3.zero, Quaternion.identity);
}

var DayLength = 24.0f;
var Hour = 0.0f;

var Blend : float;

function Update() {
	Hour = Mathf.Clamp(Hour, 0, 1) == 1 ? 0 : Hour;
	Hour += (Time.deltaTime / DayLength) / 60;
	
	TOD = Hour * 24;
	Blend = (Hour % (1.0f / 12.0f)) * 12.0f;
	
	sun.GetComponent(Light).transform.localEulerAngles = new Vector3((Hour * 360) - 90, 0,0);
	sun.GetComponent(Light).color = Color.Lerp(SunNight, SunDay, Hour);
		
	if (TOD > 4 && TOD < 6) {
    	skybox.material = NightBlendSkybox;
    	skybox.material.SetFloat("_Blend", Blend);
    	RenderSettings.ambientLight = Color.Lerp(NightAmbientLight, MorningAmbientLight, Blend);
        //it is Morning
    } else if (TOD > 6 && TOD < 8) {
    	skybox.material = DaySkyBox;
    	skybox.material.SetFloat("_Blend", Blend);
        RenderSettings.ambientLight = Color.Lerp(MorningAmbientLight, MiddayAmbientLight, Blend);
        //it is Day
    } else if (TOD > 18 && TOD < 20) {
	    skybox.material = DayBlendSkybox;
    	skybox.material.SetFloat("_Blend", Blend);
    	RenderSettings.ambientLight = Color.Lerp(MiddayAmbientLight, DuskAmbientLight, Blend);
       	//it is Dusk
	} else if (TOD > 20 && TOD < 22) {
        skybox.material = NightSkyBox;
        skybox.material.SetFloat("_Blend", Blend);
        RenderSettings.ambientLight = Color.Lerp(DuskAmbientLight, NightAmbientLight, Blend);
        //it is Night
    }
}

It does, but I fixed it. It was just some weird values. Edited the code above.