Hello,
I have created a new button in the editor menu of UE4. I want to spawn an actor when the player clicks a button (when the game is not running). I tried with NewObject but nothing happend… any ideas?
Hello,
I have created a new button in the editor menu of UE4. I want to spawn an actor when the player clicks a button (when the game is not running). I tried with NewObject but nothing happend… any ideas?
Thank you so much dude…
To spawn an actor in editor mode you also use SpawnActor like you would do at runtime.
You can get the world using this method:
UWorld* World = GEditor->GetEditorWorldContext().World();
MyActor* MyEditorActor = World->SpawnActor<AMyActor>(AMyActor::StaticClass(), Location, Rotation, SpawnInfo);