I have added a meshes system to the game, now I would like to know how to save them on the map so that they are not deleted after leaving
Hey @MonkiDG!
Can you elaborate? What do you mean by a “Meshes system”? Do you mean an instanced mesh generation actor? Do you mean you have placed meshes?
Get us as much information as you can, as accurately as you can (no pressure, just do your best!) and we’ll circle back!
yes
I made a widget and objects come out, you hit the one you want and you can place it wherever you want
So… what I’m putting together is: as part of the game, you are spawning actors, and these actors have static mesh components.
You want the static mesh components (OR the actors themselves) to stay on the level when you stop the simulation? Or is it that you want to save them so when the player leaves the level and comes back, those actors are still there?
I’ll give you a video so you can understand it a little better.
Hey, that looks great!
I had a feeling that something like this was what you were talking about.
I do have to reiterate the question though, you want it to save locations (and existence) of these objects, I get that, but do you mean when the player travels from level to level or when you stop and restart?
Either way, I suppose, this tutorial should really get you on your way!
Disclaimer: This link (YouTube) is not associated with Epic Games, Unreal Engine, or their partners. However, the creator of the video is an Authorized Unreal Instructor.
I want it to stay at the level it has been set and when you exit the game and re-enter the level it is there, I will see the tutorial, thank you
Well, it is saved but only the first mesh that I put, I’ll give you a video so you can see it, I’ll also give you the blueprints to see if you know how to solve it
That does not answer the question. Count the numbers of iterations - check the length of the array I highlighted.
In that array are the objects that spawned
You’re only asking for the first class 0, so only 1 would spawn - Mesa_B… I’ll admit - not sure what this is for - your Load already spawns actors:
Should each actor be spawned or could we try to save all the actors and spawn them at the same time?
Up to you but most of the time you will want to Save all, Load Saved → Respawn all.
if I want to do that but it doesn’t work, I think the problem is here, which is the widget where I choose the object to put
or maybe I’m wrong
I do not understand what you’re trying to do - respawn the player? Why get player class? What are we doing? What does it have to do with saving / loading?
You did not answer my question, so I’ll reiterate: is this part supposed to load and respawn everything?
If so, how many are saved and how many are loaded - count them; at least you’ll be closer to understanding what is going on.
Am I correct to think that you want to place some actors, save them, and then load them? Is that it?
yes, What I want to do is keep all the meshes that I respawn saved in the savegame, so that they are not deleted every time I leave the game.
yes
My original questions still stands: how many actors? You’re getting ALL actors of only ONE class:
Is that intentional? Count how many you’re saving. Check the length of the array or even put some prints strings in the loop.
The idea is that all the actors of the widget that you respawn are saved, if you only spawn 2 then those two actors appear when loading
all the actors are in this class but maybe that has nothing to do with it
Do I have to put get actor for each actor to save it here? is that the problem?
I don’t understand what are actors of the widgets - you’re showing clasees. And what does the widget have to do with any of this? Perhaps focus on getting the saving and loading to work first.
Again, for the 3rd time, count the actors, I bet you’re only saving one because you only look up one class and there’s only one instance. You probably meant ForEach instead of get0.