How I can save actor transform in the savegame file?

HI! How I can same my actor transform in the savegame file and then load it?

Here is an actor blueprint that get the transform of an actor.
Get transform posted by anonymous | blueprintUE | PasteBin For Unreal Engine


The blueprint works (default value)

I made an interaction button to check if it reacts to rotation change. (It does)

So the rotation is changed and it is stored in the actor blueprint. The problem is how to send the data to the savegame.

This is the Save game and the game instance. (Everything works for the main character (level, pos, transform but not for the object selected in this ‘get transform actor blueprint’).

Save Game:

Game instance blueprint: (Save-game, Load Game, Load Data into game)
Game Instance posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Level blueprint:
Level Blueprint posted by anonymous | blueprintUE | PasteBin For Unreal Engine

What do I do wrong here?

Please help :slight_smile:

1 Like

This code is wrong

It makes an array with one element in it.

Also doing this on tick is nuts :). You only need to do it when you save the game.

If you have an array of actors and you want to put that ( and the transforms in the SG ), do this

1 Like

Thank you for this quick and good answer. :grinning:
I have another question. - I can migrate the actor transform in gameinstance then take the data in it to savegame and save it and then load it?

1 Like

Yes, you can copy arrays from the game instance to the save game :slight_smile:

1 Like

When my game will release(in a distant future) you will be in the credits (Top Section) <3

1 Like

:sunglasses:

1 Like

Sometimes I’m an idiot and I cannot make things work. What I still do wrong?

Actor blueprint that is placed in level:
(S1 posted by anonymous | blueprintUE | PasteBin For Unreal Engine)

Save game / Load game / Load Data Into Game
(S/L posted by anonymous | blueprintUE | PasteBin For Unreal Engine)

User widget:

I just don’t know why I can’t get it to work :((((

Cast the thing you just loaded

image

I did this. The save game works but not the storing and loading of the “desired object” transform.

Ok, why are you removing the save game here?

image

I see that it works without deleting the game in slot. :), but still not loading desired object transform.

I’m losing track.

S1 is an actor in the level. It copies stuff into the GI. But where did it get ‘Actori’?

S/L only saves. It does not load.

“actori” is an variablle from GI. (where I want to get data from the actor placed in the level and then use it in the savegame and user widget)

But you’re setting it here. Where are you getting this variable from? What is setting IT?

Here I get the actor ref.

So you have this actor, it puts the transforms in the GI ( S1 ).

And I see you save this to the save game ( S/L ).

But where is the code for reading it back?

Object BP


Game Instance

Master Widget

When I press the “Editable Text Box_1” it should load the information. (I think this is where I am doing wrong. I don’t know how to load it)

I get it, yes. From the widget, we call the GI, which calls the object and it saves everything.

THEN, later, you have to get it all back again, right?

Where is that?

I think I don’t know how to get it back :(((

Ok, well that’s why it’s not working then :melting_face:

When you read back from the save game into the game instance, what is supposed to happen?