Save and Load player location, pls help

How To Save And Load Player's Location - Unreal Engine 4 Tutorial - YouTube Guys please help, I was following Matt tutorial on how to save and load player location, now that works, but i found 1 problem.
When i save or auto save the location on map 1 when i reach destination to go to open map 2 it doesnt spawn me on the map, its like its spawning me under the map and i cant move there is no character (this happens on every map , only when i save location) but when i do not save location then then my character normally spawns on any level, ofc if i saved location on level 1 and then click load game it will spawn me on level 1 on that exact same location but when i go to level 2 or 3 when i clicked save it wont spawn me.

To sum up, when i click save location on map 1, when i want to change level it wont spawn my character on level 2 or map 2, but when i dont save location and when i reach destination to change levels and when i enter in the portal that teleports me to level 2 my character spawns normally

Spawning under the map is a classic side-effect or starting at location 0,0,0

Are you sure you’re loading the correct coords? Try printing them to check.

The only problem is when I try to change levels it won’t spawn me on the second level when I saved the location on the first level. Maybe if I use delete the game from slot node in a level blueprint will solve the problem partially, but if I die on the second level and press continue it’s going to start from the start, not from the location I saved :smiley:

Better show your code, you definitely don’t want to delete the slot. That’s where the information is! :slight_smile:

The first image is from bp character blueprint on it is connected to event begin play

the other 2 are from the widget, I didn’t connect them right now, because I’m trying right now something :slight_smile:


You have a connection missing there.

The save game part looks ok, but it’s not connected, so there’s nothing to load.

Same thing happens, i can load the player location but my character wont spawn on second level when I save player location on the first level :smiley: Thats the problem :confused: The only time when my character spawn on level 2 after i finish level 1 is when i add delete game in slot in level 2 blueprint

Make it so that you DO save the player location, and then load it on spawn. Then show me the code.

It’s a little hard to debug if you’re showing me stuff you’re not using…

EDIT: Sorry, not very helpful. Lemme take another look :smiley:

Ok, I took another look. The code basically looks ok, but are you sure you’re spawning the right player? If it’s the default player, it won’t load the transform.

When the level starts, F8 and take a look at the world outliner. Is it the player you expect?

- YouTube In this video you can see the problem ( I’m using all the nodes I send you already).

On this video you can see that’s everything normal, that’s because In this video i didn’t save player location. I just went straight from the start to the portal without saving player location.

See above :slight_smile:

If you put debug code in the player, does it print? Is it running the load?

Yes, its spawning the player i wanted, just under the map (when I press save) like in the video :confused:


Let me try that, which debug node should I add in my character bp? Debug capsule? there are too many :smiley: or print ?

When i add print string in my character bp, it does print/load the print string text

Is it possible to delete game in slot only the first time you enter the level ?

Load the save game. If it’s 0,0,0, don’t use it.

Can you please me show an example if you have time?

These are the nodes for loading the location, what I need to do so my character wont spawn on 0 0 0 ?

Should I add branch ?

Something like:

except if you’re doing it inside the player, just use SetActorLocation, without the get player character.

Ty so much for trying to help me, but this didn’t solve the problem, I think saving and loading player location is for 1 level such as open world game but if you have more levels I think checkpoint is better ?

I don’t know what sort of game you have. Does saving the player location on level 1 and then trying to put the player in that location on level 2 make any sense?

What might make a lot more sense, is doing this on just one level.

So, move around with the player, save, quit the game, then re-open the level, and the player should be where you left it…