# How to simply spawn Actor variable?

**URL:** <https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [May 14, 2025, 10:56pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590 "2025-05-14T22:56:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [May 14, 2025, 10:56pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/1 "2025-05-14T22:56:48Z")

</div>

Some noob question sorry, but can’t find it anywhere.

I know there is a popular `SpawnActorFromClass` function, but that will not work for me. Instead, I need something even more simpler - spawn actor directly from existing variable in Blueprints:

 ![UnrealEditor_KBgXKH0NkK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/a/67aa207686cc942a3ffa61f43838899bf70598b8.png)

So I wouldn’t have to specify not the Actor class, not it’s Transform(_variable already have all those things_) and so on.

It is saved Actor from the previous game session which I store in SaveGame.  
I can save this Actor well.  
I can destroy such Actor when BeginPlay.  
But I can’t spawn it back…

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 14, 2025, 11:07pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/2 "2025-05-14T23:07:34Z")

</div>

You have to spawn from class. The class itself should have exposed variables so you can pass in the previous instances data.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 14, 2025, 11:18pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/3 "2025-05-14T23:18:03Z")

</div>

As far as I know you can’t directly restore an object instance from SaveGame, but like Rev0verDrive says you’d have to spawn a new instance from class (blueprint node == purple, not blue), then write the data from the SaveGame back into the new instance. I’d write a method for that class to be initialized with save game data, instead of publicly exposing properties. That takes some time to do but then you can make sure instances are only initialized once and that those properties are not being modified later on when they shouldn’t be.

```auto
// Public method to initialize private properties once:

UMyActor::InitializeMyActor(const FS_MyActorSaveData& InData) {
  check(WasInitializeMyActorCalled == false);
  WasInitializeMyActorCalled = true;

  // Initialize instance from InData
}

```

I remember there’s also a way to mark a blueprint property as “exposed on spawn” or something, I can’t remember the last time I used that. It bugs entirely on widgets (props not set during… OnInitialized I think?), and I avoid blueprints when I can anyway.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 14, 2025, 11:33pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/4 "2025-05-14T23:33:51Z")

</div>

There’s also the issue of actor obj references in save game not storing any modified values outside of parent class declared variables… Transform etc. Custom variables will revert to defaults. Customs have to be stored in a SG struct.

I store specifics in custom structs and have events/functions tailored to spawning them. Simple data passes I do with exposed variables. Complex I do manual sets using the spawn return reference.

---

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [May 14, 2025, 11:43pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/5 "2025-05-14T23:43:18Z")

</div>

there’s quite some info about this.  
here you can see a few other forum posts and some video tutorials.

> **[unreal load saved actors at DuckDuckGo](https://duckduckgo.com/?t=ffab&q=unreal%2Bload%2Bsaved%2Bactors&ia=web)**
>
> DuckDuckGo. Privacy, Simplified.

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [May 15, 2025, 8:53am UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/7 "2025-05-15T08:53:17Z")

</div>

> [@Rev0verDrive](#):
>
> The class itself should have exposed variables so you can pass in the previous instances data.

Not sure I fully understand what you meant here. Can you provide an example?

> [@Roy\_Wierer.Seda145](#):
>
> then write the data from the SaveGame back into the new instance.

If there would be such a possibility it would be great. But how exactly you can write in the data? I still don’t understand why it is not possible to replace entire Object reference with another one, ■■■■ it feels obvious…

> [@Rev0verDrive](#):
>
> There’s also the issue of actor obj references in save game not storing any modified values outside of parent class declared variables… Transform etc.

Just checked, it’s real. That just ruined my entire ‘simple’ plan to achieve Save/Load actors ☹

---

<div class="post-metadata">

**Author:** ![vixadama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vixadama/32/1064132_2.png) [@vixadama](https://forums.unrealengine.com/u/vixadama)\
**Post date:** [May 15, 2025, 1:44pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/8 "2025-05-15T13:44:38Z")

</div>

To simply spawn an **Actor variable** in Unreal Engine (usually in Blueprints or C++), you can follow these basic steps depending on the context:

* * *

### 🔹 In **Blueprints** :

1. **Use the “Spawn Actor from Class” node** :

2. **Store the spawned Actor in a variable** :

* * *

### 🔹 In **C++** :

```cpp
FActorSpawnParameters SpawnParams;
SpawnParams.Owner = this;
SpawnParams.Instigator = GetInstigator();

FVector SpawnLocation = FVector(0.f, 0.f, 100.f);
FRotator SpawnRotation = FRotator::ZeroRotator;

AMyActor* SpawnedActor = GetWorld()->SpawnActor<AMyActor>(AMyActor::StaticClass(), SpawnLocation, SpawnRotation, SpawnParams);

```

Make sure `AMyActor` is the type of Actor you want to spawn, and that you include the appropriate header.

* * *

### ✅ Summary:

- Use `Spawn Actor from Class` in Blueprints and **promote the output to a variable**.
- Use `GetWorld()->SpawnActor<>()` in C++ and store the return in an Actor pointer.

Let me know if you need an example for a specific type of Actor or use case (e.g., spawning with delay, from another class, etc.)!

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [May 16, 2025, 1:01am UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/9 "2025-05-16T01:01:19Z")

</div>

Thanks for your extensive reply, but you provided here just a basic stuff I already knew before creating this thread. Read the thread, I need to `Save` and `Load` Actor in it’s entirety, not just the `Transform`.

By entirety I mean all of it by time it was Saved. All kind of variables states, so it would load not a _‘fresh new’_ Actor with just correct position, but with correct everything.

But after a day digging on that I think I won’t get it so simple. There is a hundreds SaveGame products on Marketplace with different prices, no free such stuff I think. Which are do that thing I described here - save all wanted Actors and Load them out automatically.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 16, 2025, 8:02am UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/10 "2025-05-16T08:02:13Z")

</div>

> [@Engelard](#):
>
> Read the thread

Looks like an AI. lots of suspicious profiles are invading again. Some people trying to be helpful with AI content, but most with few posts and bots. If it’s not EPIC, bots here are up to no good. Watch out with links.

> [@Engelard](#):
>
> If there would be such a possibility it would be great. But how exactly you can write in the data? I still don’t understand why it is not possible to replace entire Object reference with another one

I write methods to initialize my fresh object instances with the data they need, public method to initialize private properties once. Pics for example (ignore that it’s widget example):

> [Image gets passed to Child Widget, but String does not - #8 by Roy\_Wierer.Seda145](https://forums.unrealengine.com/t/image-gets-passed-to-child-widget-but-string-does-not/2510589/8)

C++ example I posted in post 3:

> [How to simply spawn Actor variable? - #3 by Roy\_Wierer.Seda145](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/3)

> [@Engelard](#):
>
> save all wanted Actors and Load them out automatically

> [@Engelard](#):
>
> I still don’t understand why it is not possible to replace entire Object reference with another one

I think it is at runtime, but I haven’t worked with save game systems enough to tell if a fully copy is possible in that system. Usually that would be overkill and lead to huge files. Like, how would you in such case tell the system what not to write to it? For example, an exact snapshot would contain exactly where you are in a character animation, or exactly how your player camera is transitioning from A to B, a lot of data which is useless in case A but required for someone else in case B. Those properties are usually filled in automatically when running the program and have no need for 1:1 storage. The data that we do want to store isn’t always (hopefully) that much. You’d get away with storing just a spawn point for actors in many games. If games back in the day of PS2 were to store full snapshots at any time 1:1 it wouldn’t fit on a memory card.

> [https://wiki.pcsx2.net/Savestate](https://wiki.pcsx2.net/Savestate)

I tested a save game system from the marketplace a few years back, maybe Savior, maybe not, and wasn’t impressed. Because, it claimed to be such an automated process “hit buttons: save state, load state, done” but I came to the exact same conclusion. I had no idea how much data was pushed into the save game, why I would need the framework if I was going to end up manually controlling it, and why for example, I loaded the save game and ended up with a camera being attached in completely the wrong position (probably pushed into the savegame from a transition state). What I remember is that I asked this question to the creator and got the reply that that wasn’t automated 😅 . Well… Obviously I didn’t try such framework again. Currently I just write small structs of data to SaveGame (like a player’s settings) or even to INI if I want it to be editable as text.

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [May 16, 2025, 9:27am UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/11 "2025-05-16T09:27:19Z")

</div>

> [@Roy\_Wierer.Seda145](#):
>
> Those properties are usually filled in automatically when running the program and have no need for 1:1 storage.

From all your good points, this one is concluded it all.

I also checked my Actors at runtime with the breakpoint and looked inside, like ALOT of stuff in there, underestimated that. Seems like a really bad idea to save entire actor, already retreated from such a plan. Will make manually **Save/Load** functionality just for the properties I need.

And btw, I think yesterday I found it anyway(not sure, whole answer of this guy is unexplored area for me):

 ![opera_ksvTrOp2q7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/5/9957f5a48fa4eff7bf1a5953df948d2acfb86666.png)

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 17, 2025, 9:03pm UTC](https://forums.unrealengine.com/t/how-to-simply-spawn-actor-variable/2510590/12 "2025-05-17T21:03:43Z")

</div>

Serialization would be the way to go if you absolutely NEED to store the entire actor. Yet, you cannot do this in BluePrint. Has to be done in C++.

Every Actor in the game world is stored in memory (RAM). References are pointers to the memory that’s holding the data. Think of pointers as addresses to specific boxes holding specific folders and files.

When you Save Game you’re storing specific memory data to a flat file. Data is literally being written to a file on your drive. When the game closes all the “memory” data is cleared. This means the pointers/references no longer exist.

When designing your game you need to think about subsystems and functionality that are going to be implemented down the road. The design stage, preferably scope stage, is where you tweak and plot based on future needs.

How do I simplify this actor for SaveGame functionality? What aspects can I isolate/modularize to make this heavy process easier and faster down the road. End of day I want to store the smallest amount of data possible.

Take for example the character. You do not need its movement velocity or any other movement related states. You just need a transform. Everything else movement wise should be defaulted, so when you spawn back in you’re simply standing at the last place you where and looking in the correct direction.

Character cosmetics, if any, should be a very simplified data format. Mainly ID’s (Name type) that can be used to look up data table entries for the heavy data.  
e.g. Pants = Mblue\_shorts / FPink\_shorts, Shirt = MTango\_top / FGrunge\_topb etc  
This could easily be packed in a small struct.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/7/ea76b9bb94062b9c4ce3bf3f4963204b9d88d28c.png)

Character Inventory should be a Player State actor component. The SG version should be a pretty close mirror to the PS version except for Object References. They would require a new struct having an element entry for each specific obj reference.

Example of my inventory system and the SG struct I would create to store a copy.  
My inventory is a named slot based setup. “Data Inventory” is a struct that uses named slots to hold quantity counts. Simple and fluid. All other inventory items are spawned and attached actors, thus Actor Obj References. If they are null the slot is empty.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/d/ccd8597ab00e56a3c87415c8ce99ff1f8b2011ea.png)

Save Game Inventory is only holding absolute crucial information.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/4/3e4fe19c8e56038ad51ae518797159b0a3d267f2.png)
