Spawn in Game and in Editor permanent

Hey,
i am searching for a solution to spawn something in Game mode but automatically save it also in the editor map. I am sure i might have to code my own costum node but i am pretty new to unreal and c++ and i am not sure if it is even possible. Maybe someone already has a solution or could give me some advise.

Thank you!

Absolutely it can be done. Try use UWorld()->SpawnActor to spawn an actor, and use FindActorByClass in order to find them in other actors or level bp.

In editor mode you probably want to use UEditorLevelLibrary::SpawnActorFromClass();
While in Game mode all you need is a static array to store the classes of actors you have spawned at runtime then do the same process once FEditorDelegates::FOnModeChanged event executes.

Thank you, but if i spawn something in Game mode they get destroyed as soon as i go out of it, so i am not sure if this will work or is this another spawn method?

Thank you.
I still woudn’t know how i would spawn them via code into the editor map cause the spawn event can be only triggered when in game mode or am i wrong?