How to keep a timer ticking between different levels?

I built a system that counts time. With this system I can set the number of seconds in a minute, the number of minutes in an hour, the number of hours in a day and so on… My question is, how would I go about keeping my time system ticking between different levels ?

Currently my time system is built in the level blueprint but that’s where I encounter my problem. To my knowledge, there’s no way too use the same level blueprint for multiple levels, so I would need to rebuild my time system in every level I create and that’s inefficient.

I explored different possibilities in my head like building the time system in a gamemode blueprint and storing the time variables in a game instance blueprint when I load a new level and loading those variables once the next level loads.

What I want is to keep the variables (circled in the picture) across the levels and feed them to another time system in another level so they can keep ticking seamlessly. I need a bit of insight from fellow programmers :p.

Best regards.

if you want timer to continue counting as soon as the new level is loaded you must use game instance to store the last count in it because game instance is the only object which stays alive and wont get reset when loading a new level.

i think you can also set your timer inside game instance.

or you can save information about timer and read from disk as soon the new level is loaded.

after you created a custom game instance you must set ii as project game instance from project settings

You can set that variables on your game instance, that should be the same in all of your levels.

Anyway, why dont you use “UTCNow” time node? You can get seconds, minutes, hours, days, months and years from there, and store each one of that variables (or a diference between now and the first moment you want to start to count) and update it when you need.

Thanks for the insight saeedc, I appreciate you taking the time to answer. I’ll try out your suggestions and see which one suits me best. Cheers !