Hello! It’s my first topic here, and I’d like to say that I’m a begginer on UE and I apprecciate your time if you can help me.
I’m trying to create a system time with sun light rotation with Timeline. I’m using timeline because before this approach I was using event tick, and I saw some inconsistencies because of FPS, for example: my game time was not synchronized with the sun’s rotation after a few minutes. (I know, maybe I have FPS issues to explore).
My problem is specifically when I try to load the timeline data (from the load game) to restore the time of the game. And the interesting thing is that the sun rotation is correctly restored, but the game time is not. Something happens that the time is always incrementing some hours or days when I restart the game.
I have a sun light who starts in this rotation:
A timeline with duration 60s (this is the length of the day in my game. It’s short just to test it), who starts in time 0, value -90, and finish in time 60 value 270.
I call the timeline in the event begin play:
First part of the method:
Second part:
After the “seconds” node I just use the timestam to show the time/day on HUD.
And to save in my save game, I save all the variables and restore all of them in the load game.
Again, the problem is: the sun rotation is correctly restored, and starts to rotate correctly. But the time is always incrementing hours and days…
This is my load method:
Please don’t judge me if I made some big mistake, I’m learning
Thank you!