Hello,
I am trying to program a day and night cycle, by rotating the sunlight and a moonlight.
pivot.transform.Rotate (Vector3.up * cycleTimeMult * Time.deltaTime);
Debug.Log (daytime.ToString ());
//handle more
if (daytime <= 0) { //if nighttime
sunLight.intensity = 0;
nightLight.intensity = 1;
} else {
sunLight.intensity = 1;
nightLight.intensity = 0;
}
When I try to get the rotation, it logs somehting like -0.7069825 , and over time it is zero and goes back and after some cycles it switches to positive and its really weird.
I can’t determine what time of day it is when the rotation is something like -0.7 then 0 and after 2 days 0.3 or something.