Need help about day-night cycle

I made a day-night cycle script that changes other lighting properties such as brightness.
Problem is , when I run the game , brightness changes but sun and moon position changes very slowly and they are not changing together.

Here is script:

How can I make both sun-moon position and lighting property changing work together?

1 Like

Are you wanting the lighting to get darker at night?

No , problem is when sun goes up , brightness does not change. They have diffrent change time.

You need to check what the time is an adjust it accordingly. You could check between whether the sun is descending or rising to adjust the lighting and slowly change the lighting in time with it.