Save System. keeping objects destroyed or keeping objects positions/transforms

Good day so the thing I need help with has been torturing my brain. I need to know how I can keep an object from respawning once I load my save and also how to keep an object in the position I left it in my save state if anyone knows how to do this help would really be appreciated and if you don’t fully understand my explaining I will clarify further if needed @Mind-Brain @ClockworkOcean :100: :ok_hand:

the easiest way is to respawn them,

GetAllActorsOfClass->Destroy
GetAllSavedActorClass->Spawn

Right here

You need a

:slight_smile:

Respawn? I’m not sure I understand, I want to keep the objects I interacted with destroyed for example if I take an object into my inventory and then save the game, I want that object gone when I load that save, same for if I interacted with a door, I want the door position to stay when I load my save.

I tried this not sure I did it right but the objects I interacted with still came back when I load the save, and the items I added to my inventory came back into also, that’s what I want not to happen actually

1 Like

Can you show the code?

The first youtube link is the actually save blueprint i didnt do much other than creating variables in in the bo save and then using them in the bp game instance

1 Like

I think you need to call game load at the start of this sequence

Otherwise, when is SaveREF set?

There’s nothing to it. The save game is just a bucket. You put stuff in or you get it out :slight_smile:

I think all you need at the start there is

there are a few problems with ‘loading’ objects

  1. you have to match the save data to the object which requires a persistent unique ID
  2. this wont ‘load’ objects that have been destroyed since they dont exist anymore
  3. you have to ‘clean up’ the loaded object, ie what if it had an Async task running (eg. AiMoveTo)

i find it much cleaner/easier if maybe less performant to to just destroy everything that is ‘savable’ and Respawn them.

To Respawn:

  1. You save whatever exists (class, transform, relevant data) at the time of ‘Save’
  2. Destroy all save actors (so destroyed actors stay destroyed)
  3. and spawn everything from the SaveData
1 Like

About that, i tried it the first time you told me but i didnt get any results could there be something I’m missing

1 Like

“1.you have to match the save data to the object which requires a persistent unique ID”

This what you said is what I’ve been doing for my players health,ammo and location I’ve been thinking that it might be possible for doors and inventory items, but im not sure on how to do it. And what if i have more than one of the same BP_Door and i want to keep it opened when i saved my game so that when i load my save it isnt closed same for the inventory items if i pick them up i want them to stay gone. I’m just not sure how to implement it but you saying it means that its possible

(post deleted by author)