Hello,
I think my problem is quiet simple, but can’t solve it. In the script i made IF statement, which doesn’t execute even if it is true… (this script is attached to directional light).
Here is the script:
#pragma strict
var daySpeed : float;
function Start() {
daySpeed = 0.2;
}
function Update() {
transform.Rotate(daySpeed,0,0);
if(transform.rotation.x > 350 && transform.rotation.x < 360) {
Night();
}
else {
daySpeed = 0.2;
}
}
function Night() {
daySpeed = 0.01;
}