Hi, I have a functioning clock (game clock, not real time) in my UE5.2 game which works fine but it won’t save and load.
I am trying to save and load the ‘seconds’ variable to a save game blueprint where everything else saves and loads ok, but not sure that this is the correct variable or that it is being called again correctly. I would have thought the save/loaded ‘seconds’ variable would be called when the clock function starts again. Breakpoints show everything is firing.
(I’m not a programmer)
thanks
First, you don’t really count seconds, you are counting frames.
For save\load. Do prints to see if it’s actually getting saved and loaded.
Yes, print strings and breakpoints show it’s all saving and loading fine.
I believe the issue is in how or when the ‘seconds’ variable is being called on load game, but I don’t know enough.
Try this:
Place a closed gate (or branch) on track time, and open it After loading is done.
I’ve already tried a branch condition based on the loading being finished, but that didn’t work.
The clock resets on every load
.
I have a feeling it’s getting overwritten.
Maybe you setting it somewhere else, or you have a second character with the same code?
This doesn’t work, but a print string shows the condition is being set on load. What happens though is that the clock doesn’t work when i do this.
Setting somewhere else? Hmm, not that I can think of, but I will look.
You need to set bool to true after Load game
Do a print afrer set. There is no way that clock stops working, even after setting bool to true.
I did do a print after set, and yes it prints ‘Game Loaded’, but the clock does not work. If I remove the condition, the clock works.
There is something strange is happening. Can you post the full code for game load and save?
The full blueprint is too big for a screenshot, but there’s the important bit. There are a lot of variables being set.
Sorry I may have confused with a pic of a clock function using the variable ‘tick’ instead of seconds, but it’s exactly the same issue. I made a different clock function with different variables and tried it, but the same issue.
I’m probably asking too much, but can you zip up your project and send me in pm?