Hi Guys I’ve been having a problem with a script the makes day and night cycle in unity this script is in java so here are the bits I’ve been having problems with :
var dayCycleLength : float = 1440;
var currentCycleTime : float = 0;
var hoursPerDay : float;
var dawnTimeOffset : float;
var worldTimeHour : int;
var minutes : int;
var timePerHour : float;
function UpdateWorldTime()
{
worldTimeHour = (int)((Mathf.Ceil((currentCycleTime / dayCycleLength) * hoursPerDay) + dawnTimeOffset) % hoursPerDay) + 1;
minutes = (int)(Mathf.Ceil((currentCycleTime* (60/timePerHour))% 60));
}
this is actually a script made in C# that i’m trying to convert to .JS
So it gives me back this error :
BCE0024: The type ‘int’ does not have a visible constructor that matches the argument list ‘(float)’.
I really don’t know what to do please help me out!
Thanks already…