How to Save and Load your Game In Unreal Engine 5 (Easy)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new unview engine 5 tutorial and today I'm going to show you on how to save and load your game it's gonna be a very easy tutorial to follow so let's get started all right so the first thing that we have to do is go ahead and create a new blueprint okay so just go ahead and right click blueprint class I'm gonna search for save game because unreal already has this kind of set it up for us it's going to be much easier so I just go ahead and select it and I'm just gonna name it BP save okay so now if we go ahead and open this you can see that it is like pretty much like a normal blueprint okay but the thing is that we're going to be saving different things now for the purpose of this video uh I'm only going to be saving and loading the player's position okay and then you can go ahead and add more things as you want okay so basically to save a you know a piece of information on or save we're going to do is just create a variable and this is gonna be the player pause okay because it's gonna be the play position you're just gonna save it in the variable that is simple and it's going to be a transform okay so now we can compound save and go back into our third person character and the things that we're going to go ahead and add a begin play because this will do it uh right when the game starts okay so the first thing that we're going to do is those game the save game exist okay so we are gonna be asking if already um there's something saved and we can go ahead and load it or we can go ahead and create a new one now we have to set up a slot name go ahead and name it as you want in my case it's gonna be save one but you know it's like basically the name of each slot on your site okay so right from this could be a branch and I'm gonna ask if true or false now if it's false what we're going to do is create a new one so create game save object and this will be of our BP save that we have just created earlier so now we can get from this and then set the player pause because also apart from Creator net we're going to be also saving it in that instant okay so uh basically just sit like this and it's gonna be get after transform as we are saving our actual player's position and then also we have to save the attack so it's gonna be save game slot and then we just join this and remember that the slot name has to be exactly the same so save one and then basically it will be saved so I'm just going to go ahead and make this a bit better is by pulling this up over here so it doesn't look like that and there we go so now uh if the save doesn't exist it will create one and Save Our Place position and but if it already exists we have to basically load all the information so it's going to be load game save press a lot and again it's going to be exactly the same name slot so save one and then what we're going to do is cast directly to our BP safe so now we can get our information for example our player pause in this case and now a simple we can just say set um actor transform and we can just set the position of our player to be basically this one and that's pretty much it on the uh begin play pot okay so now what we have to do is save the game and load the game if we want at any time so um for example I'm going to be saying that if I you know to make things easier if I hit the key oh for example oh for example R is going to be better um we want to go ahead and say the game okay so what we're going to do is copy this block which is just says does say game exist and uh with save one on which is very important so if it exists just to make sure that you know we don't have any errors or whatever um what we're going to do is do pretty much this which is just um gets reference to our uh cast that we did earlier and set the player position and save now the thing is that we need to reference to this so just go ahead and just drag this over here right click and say uh promote variable and this is going to be our BP saved I think that's okay for now let's plug it in over here and then plug in this part so now we can just go here and get our BP save and then just get our player uh sorry set our player pause because this is basically um saving and then it's going to be untrue and then this is going to be our get actual transform so let's go ahead and copy this and paste on here and then save game to slot well I'm gonna be doing exactly the same here so just copy and paste it and then the BP is safe will go over here and they still out save one so now this will basically be saving our game so you can print um game saved so we can go ahead and check it out and then we're going to be loading the the information so for example let's say that if I press I don't know J or whatever um we'll basically load it so uh now to make things safer you can go ahead and copy this thing about dos save game exist you save one so if it does exist we're going to be loading our information so uh we can do pretty much exactly what we did here um but because we already have the reference we can just drag it we can get it and then I'm gonna get player pause and uh just drag only here and because we already have I was gonna set the transform of the actor can be on true and this over here and then I'm gonna go ahead and just print game loaded and that's as simple as it gets so now if we compile and save and press play you can see that if I were to so you can see that I spawn over here right so if I were to go up here into this section over here and now I'll press R you can see that a printed game saved so my game you say to here so now if I were to go ahead and move into another corner and now I press J which is uh the button that I assigned to load okay and it's just because I literally forgot to um also uh you know assign the variable uh when we already have the uh well what when we created it so now it will work but because it was the first time was created it I wasn't applying it so the Quick Fix is drag the variable set and then what we just set it with the return value over here and that's literally the fix all right so in now we were to go ahead and go into a position for example this one and go ahead and hit R game saved so now uh the position will be saved from here so if I were to go ahead and move into for example this corner and then press X I will be teleported F2 here so it will be loading the information also if I now exit play and then press play again I will be spawning over here because we did it on the begin play and that's pretty much it guys if you enjoyed the video and want to see more things like this go ahead and hit the Subscribe button and like the video if you have any questions or comments or unwilling to find tutorials ideas leave them in the comments and now with all that said bye bye foreign [Music]
Info
Channel: Gorka Games
Views: 47,439
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, save and load, tutorial, quixel, megascans, unreal engine tutorial, save and load unreal engine, ue5 save and load game, ue5 save and load game tutorial, ue5 save game, unreal engine saving system, unreal engine 5 how to save game, unreal engine 5 load game, unreal engine how to make a saving system, unreal engine 4, ue4, unreal engine 5 load nad save tutorial, ue5 tutorial save & load, how to save your game in ue5
Id: 14wmGdbhLOA
Channel Id: undefined
Length: 8min 6sec (486 seconds)
Published: Wed Oct 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.