Can someone describe me what is going on at video? Im trying to make a in game time with rotation of sun. Using “goodsky” as skyBP. It is working but when is speed lower than about 20x, it will be stuck in 12. At the same time, when speed is lower than 20x and i press ALT+S or F8 (Simuluate Mode), It will work too. I cant understand that.
All BP about sky is in video.
Also, there is no problem about Time Widget. Sun doesnt move when it stuck at 12.
If you know any sky blueprints which will help me to make a time system syncronized with sun, tell me please. It would be so good!
Is it normal your clock goes from 0 to 12 and then 12 to 0 ?
I don’t see any code regarding clock, yet in your video the clock goes faster with 20 than with 5. Does that mean the clock is calculated from sun rotation ?
If that’s the case, I would highly suggest doing the opposite.
Rather than adding a delta rotation every frame, use an intermediate variable to hold day time. For example create a float variable named DaySeconds. Every tick, compute DaySeconds = (DaySeconds + X*DeltaTime) % 86400. Now you have a proper looping day time variable, from which you can easily format the clock text widget and compute an absolute rotation.
Thanks! It looks like working. But i had a problem. Time is 6 hours ahead. I mean, the sun should be on top at 12:00 but it is in 18:00. Do you have any suggestion to fix that?
Yeah it just a simple rotation correction. 6 hours would be 90 degrees.
After the “Map Range Clamped” node, add or subtract 90 to the result.
Or directly change the Out Range to either [90 : 450], or [-90 : 270].