Hey guyz,
I want a sun go around my level and this is gonna be done with a constant incrementing of it’s rotation.x using the Transform.Rotate function.
But I want to set the time at any moment ingame and the sun’s rotation has to change, too For those who don’t understand me: at 0am rotation shall be 270° so the sun shines from down to up and no light is on the terrain. At 12am the rotation shall be 90°, becouse then the sun shines from above and lights everything.
I tried this: sun.eulerAngle = new Vector3(360 * currentTime / maxTime, 0, 0);
but at ~90° the sun acts completely weird!! it flips from the negative of it’s current x-rotation to the positive, BUT: this bug only appears for the x-axis >_<
what am i doing wrong?