# Spawn Actor to the world before level editor showup

**URL:** <https://forums.unrealengine.com/t/spawn-actor-to-the-world-before-level-editor-showup/563126>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 22, 2022, 3:17am UTC](https://forums.unrealengine.com/t/spawn-actor-to-the-world-before-level-editor-showup/563126 "2022-05-22T03:17:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ping29](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ping29/32/88717_2.png) [@Ping29](https://forums.unrealengine.com/u/Ping29)\
**Post date:** [May 22, 2022, 3:17am UTC](https://forums.unrealengine.com/t/spawn-actor-to-the-world-before-level-editor-showup/563126/1 "2022-05-22T03:17:18Z")

</div>

Hello, I was trying to spawn new actors into the map but before the Unreal Editor fully opens, so I don’t have to drag these actors from blueprint to the level editor one by one.  
Here is what I tried:  
I was placing the spawning code in the constructor, but inside the constructor, `GetWorld()` function will return null, thus it won’t work. Then I tried to move the code to `BeginPlay` function, but now I can only see the player instance after I hit the Play button. Is there a way to spawn the actor into the world in runtime but before Unreal Editor fully loaded? following is the code I used.

```auto
ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
ActorSpawnParams.Instigator = this;
AObstacleActor* StaticMeshActor = GetWorld()->SpawnActor<AObstacleActor>(StaticMeshActorClass, FVector(500.0f,76.0f,205.0f),FRotator(0,0,0),ActorSpawnParams);

```
