# Check if an actor was placed in editor, or spawned at runtime?

**URL:** <https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 13, 2016, 9:00pm UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272 "2016-10-13T21:00:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Juice-Tin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juice-tin/32/1008648_2.png) [@Juice-Tin](https://forums.unrealengine.com/u/Juice-Tin)\
**Post date:** [October 14, 2016, 6:13pm UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/4 "2016-10-14T18:13:23Z")

</div>

Found a solution to my problem.

```
FTransform spawnTrans = FTransform(flinchDir.Rotation(), GetActorLocation());
APickup* pickup = GetWorld()->SpawnActorDeferred<APickup>(SpawnItem, spawnTrans);
pickup->ID = DropItem.ID;
pickup->WasSpawned = true;
pickup->FinishSpawning(spawnTrans);

```

Lets you initialize variables on an actor before actually spawning it. This way you can set certain variables, before it runs it’s BeginPlay.

---

_[View the full topic](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272)._
