How would I be able to smoothly tween TimeOfDay or ClockTime?
Of course you would just tween it normally, but the issue is:
If I want to tween the time from 22 to 2, instead of the clock going 4 hours forward, it goes 20 hours backwards.
This obviously looks very stupid and unnatural.
So here is how my time script works:
Every second the Minute value gets increased by 1
If the Minutes value is 60 the set Minutes to 0 and increase Hours by 1.
If Hours reaches one of the values listed below, it sets the ClockTime to that value.
On hours 4, 6, 9, 12, 17, 21, 24 (0) properties of Lighting get changed.
I already figured out how to tween the fog, ambient, etc. Im just stuck at the time.
The only thing I figured out so far is that if Hours reaches 0, tween ClockTime to 23.999 and check every frame if the ClockTime is 23.999 and if so set it to 0.001.
This works correctly, but only if the time goes forward.
If I change the time from 2 to 22, the clock adds 20 hours instead of going 4 hours back.