# 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:** 7\
**Page:** 1

<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 13, 2016, 9:00pm UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/1 "2016-10-13T21:00:47Z")

</div>

Hello, how can I tell if an actor was placed using the editor (a coin in the world), or spawned at runtime (from a killed enemy) from within the BeginPlay function?

I need this so the coin can set up it’s parameters, such as to persist as a world coin, or to bounce around and face out.

Thanks!

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [October 14, 2016, 4:06am UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/2 "2016-10-14T04:06:31Z")

</div>

If it was spawned in editor then the coin is visible with out hitting the play button. If it shows the moment you run the game then it was spawned by a blueprint (like the event begin play, you an event that was caused by your enemy dying, etc.)

---

<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:04pm UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/3 "2016-10-14T18:04:35Z")

</div>

I meant programmatically, how can the Coin class know if it was placed or spawned, so it can set it’s values properly.

---

<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.

---

<div class="post-metadata">

**Author:** ![dancode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dancode](https://forums.unrealengine.com/u/dancode)\
**Post date:** [January 19, 2019, 11:56pm UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/5 "2019-01-19T23:56:45Z")

</div>

All Actors have a variable called “bNetStartup” with the description “If true, this actor was loaded directly from the map, and for networking purposes can be addressed by its full path name”.

I have been able to check if an actor was placed in the map or spawned by using this flag.

It is useful for if you play a sound on spawn in PostInitializeComponents() for instance and do not want to play the sound if the actor started spawned in the world.

---

<div class="post-metadata">

**Author:** ![BreakMaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/breakmaker/32/971651_2.png) [@BreakMaker](https://forums.unrealengine.com/u/BreakMaker)\
**Post date:** [May 25, 2019, 9:48am UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/6 "2019-05-25T09:48:18Z")

</div>

I could not find the variable you mentioned. Maybe it is not in 4.19 or above any longer?

---

<div class="post-metadata">

**Author:** ![dancode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dancode](https://forums.unrealengine.com/u/dancode)\
**Post date:** [May 25, 2019, 6:21pm UTC](https://forums.unrealengine.com/t/check-if-an-actor-was-placed-in-editor-or-spawned-at-runtime/373272/7 "2019-05-25T18:21:36Z")

</div>

Actor.h line 150 in 4.22.1

UPROPERTY()  
bNetStartup:1;
