Float variable not even updating?

So I’ve got one script, called “Timekeeper”, which does exactly what you’d think, and another script called “SkyEffects”. SkyEffects needs a number between 0 and 1 to control the blend of two cubemaps in my skybox material, so the simple answer is to take the secondOfDay from Timekeeper, and divide it by 86400 (because there are 86400 seconds in a day).

The problem is that Unity doesn’t seem to want to do even simple math, and the variable SkyboxBlendFactor isn’t updating at all. What’s more, the AnimationCurve on line 2 of SkyEffects defines keyframes, but those keyframes aren’t shown in Unity.

Timekeeper.js:

static var hours : int;
static var minutes : int;
static var seconds : int;
static var secondOfDay : int;
var speed : float;
var syncWithSystemTime : boolean;


function Start () {
	if(syncWithSystemTime){
		secondOfDay = (System.DateTime.Now.Hour * 3600) + (System.DateTime.Now.Minute * 60) + (System.DateTime.Now.Second);
	}
	InvokeRepeating ("countUp", 0, speed);
}

function countUp () {
	if(secondOfDay < 86400)
		secondOfDay ++;
	else
		secondOfDay = 0;
}

function Update () {
	hours = secondOfDay / 3600;
	minutes = (secondOfDay / 60) - (hours * 60);
	seconds = secondOfDay - (minutes *60);
	//print (secondOfDay.ToString());
}

SkyEffects.js

var SkyboxMaterial: Material;
var SkyboxBlendCurve: AnimationCurve = new AnimationCurve(Keyframe(0,0), Keyframe(.20, 0), Keyframe(.29, 1), Keyframe(.79, 1), Keyframe(.87, 0), Keyframe(1, 0));
var SkyboxBlendFactor: float;

function Update () {
	SkyboxBlendFactor = Timekeeper.secondOfDay / 86400;
}

This is integer division. You need to change secondOfDay to a float OR cast it as a float when you divide it. More information is here: Why does integer division in C# return an integer and not a float? - Stack Overflow

EDIT, try:

SkyboxBlendFactor = Timekeeper.secondOfDay / 86400.0f;