How to save location of player

You don’t set the Save Game Instance variable which you use later in your BP. You must store the return value from the Load Game from Slot node and there is no need to create a Save Game when loading as it will be created from the load function.

You also should get errors when executing that code, it is always wise to see what the messages say to find errors in your code.

Hello!
I’m doing saves to my game. But i have a problem. I’m saving location, but when I want to load it game starts, but nothing happens. Game isn’t teleporting me to the saved loaction.
Below are screenshots of blueprints.

I set it, it is on variable list. And I don’t have any errors.
From “create save game object” I created node to “cast to save game 1”, and I promoted “As save game 1” to variable.
Next, when I already had that variable, I deleted “cast to…” and set “Save Game Instance” nodes.
That variable is casting to save game 1. And I think i t is casting even if I delete that nodes. Correct me if I’m wrong.

To debug if everything is right, you could print the transform to the screen to see if it was saved and loaded succesfully.

And yes, you must cast the Save Game to your Save Game Class but not from the “Create Save Game” node but from the “Load Save game from Slot” when loading, you create the Save Game when you save your game, not on loading.

I tried to print transform after loading, but nothing happened

Have you made sure the load event does fire? Because even if the transform was not loaded correctly, it should be at zero.

How to make sure? I tried to cast from “Load Save Game From Slot”, but when I clicked on Load Game in menu, nothing happens, no loading screen.

When you want to make sure an event fires, just put a Print node at the start at the event, if the string is printed to the screen you see that it has fired.

This is how a load function can look like:

Another prolem in your code is, that you get the slot name and user index from the save game. You load the save by that name, so you cant load it first and than get the name. Try it with a default name to see if thats the problem.

Now it prints transform but it’s deafault transorm.

132832-przechwytywanie.png

Have you made sure you saved the correct location?
And that you use the same name and index for loading and saving?

Maybe you could post how your blueprints look now.