This seems like something that I have been looking for but I will need to analyse it later. For a tutorial regarding such important topic this video would deserve more views.
Thanks Matt. This was just what I was doing this week. I'm sure you know this but at 20:42, you cannot use the name of the block, well... you can't use the Display Name but you can use the Object Name. They are the same in the editor but it doesn't work after compiled (per the forums). (No idea why, but the docs say not to use the display name). I'm messing with a kind of city building game so I fixed this by creating a variable of type GUID in the block and then passing a GUID to my block when I created it, using New GUID, since I was creating them on the fly. And that worked. I saved the GUID in the block because it's guaranteed to be unique. C++ users have a MakeUniqueObjectName but Blueprints do not. My issue currently is working out how to save all of the different block's data. For now I created arrays in the SaveGame object.
Tidbit: Theres a 'Delete Save in Slot' Node you can use. Also, yes Unqiuely identify name help would be great, i got thousands of em to track!🤣🤣 Edit: Nevermind, Figured it out! Instead of using a Variable in the Pickup (Actor ID) Do get object name > Self > Convert string to name, and plug that in to the destroy and check nodes as the ID instead. Just for anyone who wanted to know, seems to work for me so far over my 5 mins or so of testing it
Can you show how it's look like? I'm doing it but nothing works. Destroyed Actors Array is showing exact objects name so i am doing it properly but items are not destroyed. If i do it like in this video, Actor id is other than what I wrote (print string after call destroy item function in pickup event)
Hello there! Im sorry but, could you please help us understand by somehow showcase how this is done? (lacking the understanding of how to convert and whatnot, or the rest of the process.) Thank you in advance! Edit: Might Have done it (not entirely sure) however while it works in PIE, destroyed actors are not saved when building/ packaging the game. Any of you guys have any ideas?
@@ManthosLappas how are you pulling the name? I use 'reference to self > drag off and type to 'string' you should get a node with two coloured dots, the pink being the string > drag off string pin and type 'to name' this should give you another two nodes this time pink to purple, then plug the name into the add to array and done, dont use the 'get object name' node, seemed to cause me issues, also when looking up the item on begin play, when searching if the actor is in the arrayi found 'contains' more reliable thn 'find actor in array, > 0' method in the video, maybe these can help you out, i actualy came back to this comment to redo the save system for myew game and found my own comment to help me lol, it works perfectly in my game, havent tested a build project yet but im just about too so il update in a bit Also some names might not be unique ie same actor name could appear in another level so u can either save to a slot using the level name as slot and only load the array for that level, or add a level prefix to the item name ie 'Lvl_1_Door_1' that way if theres a Door_1 in level two as well, when level two is loaded it wont delete that acto, only the version in the appropriate level might do a video on this to be fair, could be more helpful than a wall of text
Thank you for the great video. I can confirm this is still 99% the same for unreal engine 5.3; as one user mentioned below instead of manually assigning a variable with a name of the object, you can call ``call reference to self>get object name`` and put the return value into the Name return pin (and create the auto-changer between string and name). The save process can be easily applied to widgets, which is what I needed (the widgets' "event begin play" has the name "event construct" instead). Thank you.
This works fine for 1 level but across multiple levels, game objects like coins can have the same name. There fore if you pick up "Coin1" in level 1 it also deletes "Coin1" in level 2. Try using "GetObjectPathString", this works the same but also across different levels.
The first thing to thank you very much for your tutorials, tell you that it works for me and not at the same time hehehe, I explain, I already had a system to save health and mana (in the player interface), amount of coins collected (in the interface the player), number of keys collected (in the interface the player), my system saved and loaded this data well, the problem I had is that, when I collected for example a coin, in the interface it reflected it well but the currency when loading the game It reappeared and of course your video was just what I needed. Of course I do not have the same configuration as you in the video, for example I save and load from the menu pause / Save-Load and the CustomEvent save load I have it in the gameinstance not the PlayercontrollerBP (MyPlayerController BP in your video), this is where it happens to me that if: I give it play game from level 1 for example, I pick up an item, I go out and load, the item and this is not there, it works perfect, but if I hit the menu and give it a new game and load from the menu pause / Save-Load the Items are back hehehe, total madness hahaha. My question is all the custom event that you put in MyPlayerController (save - load), can I put it in my game instance and thus make a hybrid between what I have and what you explain in the video? I would understand that you think I'm totally crazy hahaha. Sorry for my language as I do not know English and I am a translator. Greetings and thank you, even if you do not answer this bible :)
Nicee, can confirm that this works on UE5.4.3. I nearly commented saying it wasn't working but I was missing a pin. To anyone struggling, I recommend playing game in new editor window, open each script and changing debug object to whatever it's using and looking at the script execution lines to see if they go far enough. Having a load hotkey button is handy for that too
Haha I remember struggling to get a simple moving platformer to work for nearly 5 hours after watching a tutorial. I forgot to tick a box, that was it lol.
i'm interested in knowing what the drawback would be to saving the destroyed actors array directly to the save game instead of to the instance and then updating it in the insatance?
finally I was able to do it, I tried many times in total spent about 10 hours on it ... I don’t understand why it worked after your video the first time ...
Any particular reason to save inside controller instead of game instance? Nevermind, this won't work for me, since I have pickupable items that are spawning in the world.
Hey could you show how to automagically assign an ID to the items? I need this because the player has an option to drop an item and if it does I need a way to assign it a new ID. EDITED: I got the auto assigning an ID worked out but player drops the item from inventory it auto disappears. Is there a way to assign it a new ID?
hello! when i saving game error says: Blueprint Runtime Error: "Attempted to assign to None". Blueprint: myplayercontroller Function: Execute Ubergraph Myplayercontroller Graph: EventGraph Node: Set DestroyedActors
Unlikely I'll get a response, but how would one go about doing this over multiple maps? I'm struggling to keep track of ID numbers and would prefer each level starts with an ID of 0 rather than 0,2,4 in firstmap and 1, 3, 5 in secondmap. I could of course reorder things but once there's so many id's it's difficult to keep track and reorder so many. I have a working method where an additional variable checks what level to look in, but this adds another variable and was hoping I could do it in a way that only requires one. Say, making just a single string that has the integer and map name and then split it. (Even this feels inefficient though)
Hey, very usefull video, thanks. If you have a good method to automatically assign a unique ID to an item or pawn when they get dragged (or spawned) to the scene I would be very interested!
A bit late, but out of the blue I woul use the actor name in combination with the world location. Very unlikely that two actors share the same origin. And if they do, they will have different names^^
When I log out of the game to the desktop and after logging in, objects are not deleted but when I load 2 times in a row, it works properly. What is the problem?
This happens on different levels as well because I have the same problem when I go to the main menu and click the load button.does anyone have any ideas?
usefull tutorial. thanks! but if u have inventory item and drop item function, once u save the destroy actor, the id will stick. and when u reload and drop the item, it will destroyed.
Hello Matt, and everyone. Wonderful video, just like always, Thank you for making this as well the rest of your content. I would like to ask about a problem that occurs. Creating a new game option-by using the "delete save in slot" command before opening level results starting a game where destroyed actors remain so. It is only when the game is completely shut down/quit to desktop that seems to initiate a new game with the destroyed actors properly restored. However, This doesnt seem to work when the game is open and wish to go from in-game or game menu to main menu and do "new game". In addition-Update: The video solution seems to not work when building /packing the game. Its only in the PIE that actors do remain destroyed after loading. Any suggestions for possible fixes? Thank you again.
Everything is working, but its not connected when you want to start new game, when you press new game and you want to start the game from beginning the actor is still destroyed, how can i fix this ? Since it is not mention in tutorial :) May you please tell me ? :)
@@megtwin Hi there! having the same problem here, added a "Delete Game in Slot"(for new game function) but still the same problem-actors are destroyed unless the game is manually quit to desktop completely and restarted again. Any ideas? Thank you for your time.
@@megtwin hello there, no worries, it's kinda been frustrating that it only works after the game has been shut down and re opened. Guess will look around more into it. I appreciate your reply regardless! :)
I've been trying for days and buggered if I can get it to work. Did you? Also my large save game function already existed in my character blueprint whereas Matt does it in the player controller. Don't know if this is messing it up. I'm not getting any error messages, it's just not doing anything, all AI respawns as normal.
@@ManthosLappas I don't know enough to know why it only works in editor mode, but I did get mine to work eventually and it also works in Standalone mode. I can look into it a bit and tell you what I did, if you can't work it out.
@@studiobaxter1242 Thank you kindly for your reply. I managed to get it working on standalone, but unfortunately, not in a packaged game which is the most important. I would be interested to get an opinion on the latter or suggestions if that is not a trouble. Appreciated!
Hey mate, if you have the claws and eyes, you could maybe make a blueprint and place them all inside together, or if not, you could open the mesh in Blender and create claws and eyes onto it
Hi there, can you please explain where exactly do you change that into object name and how? (not sure what command to insert/replace and where into) Thank you in advance!
@@turbolol-0 Hello there, Thank you kindly for your quick reply, I do appreicate that. Yes, I believe I havefigured that out. It seems to work but sadly, actors are not saved when playing the built/packaged game so thats something to investigate. Cheers!
This seems like something that I have been looking for but I will need to analyse it later. For a tutorial regarding such important topic this video would deserve more views.
Thanks Matt. This was just what I was doing this week. I'm sure you know this but at 20:42, you cannot use the name of the block, well... you can't use the Display Name but you can use the Object Name. They are the same in the editor but it doesn't work after compiled (per the forums). (No idea why, but the docs say not to use the display name).
I'm messing with a kind of city building game so I fixed this by creating a variable of type GUID in the block and then passing a GUID to my block when I created it, using New GUID, since I was creating them on the fly. And that worked.
I saved the GUID in the block because it's guaranteed to be unique. C++ users have a MakeUniqueObjectName but Blueprints do not.
My issue currently is working out how to save all of the different block's data. For now I created arrays in the SaveGame object.
Tidbit: Theres a 'Delete Save in Slot' Node you can use. Also, yes Unqiuely identify name help would be great, i got thousands of em to track!🤣🤣
Edit: Nevermind, Figured it out! Instead of using a Variable in the Pickup (Actor ID) Do get object name > Self > Convert string to name, and plug that in to the destroy and check nodes as the ID instead. Just for anyone who wanted to know, seems to work for me so far over my 5 mins or so of testing it
You're the GOAT dude. I was about to have to manually adjust the ID name of 600 different hand-placed collectibles in my game
@@minilabyrinth Glad my little comment helped someone!
Can you show how it's look like? I'm doing it but nothing works. Destroyed Actors Array is showing exact objects name so i am doing it properly but items are not destroyed. If i do it like in this video, Actor id is other than what I wrote (print string after call destroy item function in pickup event)
Hello there! Im sorry but, could you please help us understand by somehow showcase how this is done? (lacking the understanding of how to convert and whatnot, or the rest of the process.) Thank you in advance!
Edit: Might Have done it (not entirely sure) however while it works in PIE, destroyed actors are not saved when building/ packaging the game. Any of you guys have any ideas?
@@ManthosLappas how are you pulling the name? I use 'reference to self > drag off and type to 'string' you should get a node with two coloured dots, the pink being the string > drag off string pin and type 'to name' this should give you another two nodes this time pink to purple, then plug the name into the add to array and done, dont use the 'get object name' node, seemed to cause me issues, also when looking up the item on begin play, when searching if the actor is in the arrayi found 'contains' more reliable thn 'find actor in array, > 0' method in the video, maybe these can help you out, i actualy came back to this comment to redo the save system for myew game and found my own comment to help me lol, it works perfectly in my game, havent tested a build project yet but im just about too so il update in a bit
Also some names might not be unique ie same actor name could appear in another level so u can either save to a slot using the level name as slot and only load the array for that level, or add a level prefix to the item name ie 'Lvl_1_Door_1' that way if theres a Door_1 in level two as well, when level two is loaded it wont delete that acto, only the version in the appropriate level
might do a video on this to be fair, could be more helpful than a wall of text
Thank you for the great video. I can confirm this is still 99% the same for unreal engine 5.3; as one user mentioned below instead of manually assigning a variable with a name of the object, you can call ``call reference to self>get object name`` and put the return value into the Name return pin (and create the auto-changer between string and name).
The save process can be easily applied to widgets, which is what I needed (the widgets' "event begin play" has the name "event construct" instead).
Thank you.
This works fine for 1 level but across multiple levels, game objects like coins can have the same name. There fore if you pick up "Coin1" in level 1 it also deletes "Coin1" in level 2.
Try using "GetObjectPathString", this works the same but also across different levels.
it doesn't work for me : ( how can i fix this?
The first thing to thank you very much for your tutorials, tell you that it works for me and not at the same time hehehe, I explain, I already had a system to save health and mana (in the player interface), amount of coins collected (in the interface the player), number of keys collected (in the interface the player), my system saved and loaded this data well, the problem I had is that, when I collected for example a coin, in the interface it reflected it well but the currency when loading the game It reappeared and of course your video was just what I needed.
Of course I do not have the same configuration as you in the video, for example I save and load from the menu pause / Save-Load and the CustomEvent save load I have it in the gameinstance not the PlayercontrollerBP (MyPlayerController BP in your video), this is where it happens to me that if:
I give it play game from level 1 for example, I pick up an item, I go out and load, the item and this is not there, it works perfect, but if I hit the menu and give it a new game and load from the menu pause / Save-Load the Items are back hehehe, total madness hahaha.
My question is all the custom event that you put in MyPlayerController (save - load), can I put it in my game instance and thus make a hybrid between what I have and what you explain in the video?
I would understand that you think I'm totally crazy hahaha.
Sorry for my language as I do not know English and I am a translator.
Greetings and thank you, even if you do not answer this bible :)
Much later with a bigger game, yes indeed the delay did need to be increased, which worked. Thanks again.
Nicee, can confirm that this works on UE5.4.3. I nearly commented saying it wasn't working but I was missing a pin. To anyone struggling, I recommend playing game in new editor window, open each script and changing debug object to whatever it's using and looking at the script execution lines to see if they go far enough. Having a load hotkey button is handy for that too
Haha I remember struggling to get a simple moving platformer to work for nearly 5 hours after watching a tutorial. I forgot to tick a box, that was it lol.
So happy to find this, thanks for making this tutorial and all the others you have made!
Best tutorial ive found regarding level states!
i'm interested in knowing what the drawback would be to saving the destroyed actors array directly to the save game instead of to the instance and then updating it in the insatance?
6:46 I'm adding this as a reminder to future me to change delay since my game will take longer to load late
Could you please make a tutorial on how to create a spawn animation for the character everytime it dies? i.e. teleporing in, scanning in, etc.
Yes i am also waiting for it
@@galaxyofinfotainment thumbs up so he can see it.
@@Othman1992on already did✨😀
finally I was able to do it, I tried many times in total spent about 10 hours on it ... I don’t understand why it worked after your video the first time ...
Thank you! Its so greate to find a realy good video about Save Actors!
Can you make a tutorial how to equip and drop guns please . BTW good explanation
Yes please
depends on the end system :)
th-cam.com/video/b6XBzGWoe0I/w-d-xo.html&ab_channel=Beardgames
simple one...
Hey, I can add that to my list yeah, and thank you :)
@@MattAspland thank u
@@MattAspland thanks bro
Any particular reason to save inside controller instead of game instance? Nevermind, this won't work for me, since I have pickupable items that are spawning in the world.
Such a useful tutorial, thanks a lot !
Hey could you show how to automagically assign an ID to the items? I need this because the player has an option to drop an item and if it does I need a way to assign it a new ID. EDITED: I got the auto assigning an ID worked out but player drops the item from inventory it auto disappears. Is there a way to assign it a new ID?
Did you find a solution? I have the same problem right now
@@magicool27 Unfortunately not yet. But if I find one I'll post it here.
Self>GetObjectPathString effectively assigns a unique id for each object and works over different levels.
@@tobysmithgame I figured it out awhile back but thanks!!
hello! when i saving game error says: Blueprint Runtime Error: "Attempted to assign to None". Blueprint: myplayercontroller Function: Execute Ubergraph Myplayercontroller Graph: EventGraph Node: Set DestroyedActors
Try setting the "SetDestroyedActors" to public that worked for me.
Updates to UE5.3?
does it affect to save and load or checkpoint game?
Unlikely I'll get a response, but how would one go about doing this over multiple maps? I'm struggling to keep track of ID numbers and would prefer each level starts with an ID of 0 rather than 0,2,4 in firstmap and 1, 3, 5 in secondmap. I could of course reorder things but once there's so many id's it's difficult to keep track and reorder so many. I have a working method where an additional variable checks what level to look in, but this adds another variable and was hoping I could do it in a way that only requires one. Say, making just a single string that has the integer and map name and then split it. (Even this feels inefficient though)
Use: Self> GetObjectPathString and plug that into ItemID instead of the ActorID.
Do you know how to access the nav mesh bounds, because I'm on macbook pro and I don't know how.
The area that has the nav mesh bounds?
Super useful! Well explained too.
Thanks Steve! Happy to hear it :)
Sadly after I Packaged the game the actors just didn't spawn. Any fix for this issue? (it's the only thing that don't work in my game xD)
Hey, very usefull video, thanks. If you have a good method to automatically assign a unique ID to an item or pawn when they get dragged (or spawned) to the scene I would be very interested!
A bit late, but out of the blue I woul use the actor name in combination with the world location. Very unlikely that two actors share the same origin. And if they do, they will have different names^^
@@klausvogler6710 Yes I guess it's not a bad way thanks!
Doesn't work for me so far , though i am trying this in SGKv2 as a base project.
When I log out of the game to the desktop and after logging in, objects are not deleted but when I load 2 times in a row, it works properly. What is the problem?
This happens on different levels as well because I have the same problem when I go to the main menu and click the load button.does anyone have any ideas?
So... next up save the character??? Save files? Etc? :)
Hey mate, I have a few on saving and loading, let me know if they are of any help to you :)
th-cam.com/play/PLQN3U_-lMANPXaQuK_e_AtRBTlKfH4Qih.html
usefull tutorial. thanks! but if u have inventory item and drop item function, once u save the destroy actor, the id will stick. and when u reload and drop the item, it will destroyed.
Do you know a solution?
Hello Matt, and everyone. Wonderful video, just like always, Thank you for making this as well the rest of your content. I would like to ask about a problem that occurs. Creating a new game option-by using the "delete save in slot" command before opening level results starting a game where destroyed actors remain so.
It is only when the game is completely shut down/quit to desktop that seems to initiate a new game with the destroyed actors properly restored. However, This doesnt seem to work when the game is open and wish to go from in-game or game menu to main menu and do "new game".
In addition-Update: The video solution seems to not work when building /packing the game. Its only in the PIE that actors do remain destroyed after loading.
Any suggestions for possible fixes? Thank you again.
The solution to this is to call the load game event with get game instance after begin play within the character or level bp.
Waste of time, I did it literally as in the tutorial and I never save anything
Everything is working, but its not connected when you want to start new game, when you press new game and you want to start the game from beginning the actor is still destroyed, how can i fix this ? Since it is not mention in tutorial :) May you please tell me ? :)
If you start the game from the beginning you need to delete the save slot first.
@@megtwin Hi there! having the same problem here, added a "Delete Game in Slot"(for new game function) but still the same problem-actors are destroyed unless the game is manually quit to desktop completely and restarted again. Any ideas? Thank you for your time.
@@ManthosLappas Hi there. Sorry, I have not figured out how to actually delete the saved slot from within the editor.
@@megtwin hello there, no worries, it's kinda been frustrating that it only works after the game has been shut down and re opened. Guess will look around more into it. I appreciate your reply regardless! :)
@@ManthosLappas If you find anything out, please let me know.
Is there a way of adding to this to save and load AI spawn transform , to save and load AI location ?
I've been trying for days and buggered if I can get it to work. Did you?
Also my large save game function already existed in my character blueprint whereas Matt does it in the player controller. Don't know if this is messing it up. I'm not getting any error messages, it's just not doing anything, all AI respawns as normal.
@@studiobaxter1242 Hi there, I am doing the same thing as you do, while no errors it only works in pie, but not in packaged game. No idea why.
@@ManthosLappas
I don't know enough to know why it only works in editor mode, but I did get mine to work eventually and it also
works in Standalone mode. I can look into it a bit and tell you what I did, if you can't work it out.
@@studiobaxter1242 Thank you kindly for your reply. I managed to get it working on standalone, but unfortunately, not in a packaged game which is the most important. I would be interested to get an opinion on the latter or suggestions if that is not a trouble. Appreciated!
@@ManthosLappas
Sorry, as to why it doesn't work when packaged is out of my league. I'm not even up to packaging a game yet.
i have a mesh and i want to put on it claws and eyes how?
Hey mate, if you have the claws and eyes, you could maybe make a blueprint and place them all inside together, or if not, you could open the mesh in Blender and create claws and eyes onto it
@@MattAspland 🙏 thx
@@MattAspland i want the same thing but what bluprint should i use
@@prostar5862 Hey mate, a blueprint actor should work great
@@MattAspland ok iplaced them all togther now how to let them not moving like i can pull it
Bro, your my god ❤
Didn't work for me anymore :(
thanks matt you did for me
Nice video 😊
Thanks a lot bro! :)
a better method is to serialize the actor and use the GUID, then spawn with the correct class and transform and stuff
Tip: Use OBJECT NAME instead of an unique variable...
Hi there, can you please explain where exactly do you change that into object name and how? (not sure what command to insert/replace and where into) Thank you in advance!
@@ManthosLappas Havent used Unreal in a while, but I think there's a node called
'Object Name'. You can't change it's value but it is unique.
@@turbolol-0 Hello there, Thank you kindly for your quick reply, I do appreicate that. Yes, I believe I havefigured that out. It seems to work but sadly, actors are not saved when playing the built/packaged game so thats something to investigate. Cheers!
@@ManthosLappas You got it, hopefully you'll figure it out!
@@turbolol-0 Thank you!
Yea , got it working , thanks
thanx matt
Nice lacture
Cheers bro :)
gg