How to get path to Blueprint Actor from C++ and Spawn it?

I’m trying to setup Save&Load system. For that to work properly I need to handle actors that we spawned during game runtime. I’ve found a lot of examples where Blueprint actor can be spawned via hardcoded path like so:
example
How to get this path from C++? I have array of actor pointers that we spawned during runtime. Can I get this path from it?

Yes, when you are saving you can assign Actor->GetClass( ) to a TSubclassOf<Actor> or TSoftObjectPtr<AActor>. Either one of those will be serialized into the save game and they should restore properly to use to respawn the actors you need to.

image

You can get a reference to the path of the parent class, but having a path to the asset won’t help with a save/load system- it doesn’t save data.

You’ll have to manually save and load what you want specifically. Although there are pretty advanced ways to fully save an actor, that gives you much less control and balloons your save file size.