Best place to calculate game world time?

So yea, I have a rather basic skybox actor which controls directional/sky lights, atmosphere, clouds, and such along with converting delta seconds to the in-game time and date. Currently, the actor lives in the main world partition map. This works well enough on its own, but at some point I would like the time to persist across the game instance so that time passes after travelling to an interior map or whatever.

Would it be best to just strore the time/date var to the game instance or savegame on travel and add the sky actor to every map, reagardless of whether the sky is visible? Or would it make more sense to move the time calculation into level blueprints with the var set in instance on travel and have the sky read from them? Or should something like this tick in the game mode?

Game instance persists so it can just stay there and do it’s thing. If i’m understanding correctly.

My first thought was to do it in the game instance, but the instance class doesn’t have a tick event. In theory I could change that in c++, but presumably there’s some reason it doesn’t.

Do the calculations in game mode, and keep var in instance (game mode gets reset on level change). You can do it in level blueprint, but then you have to copy code to every level.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.