# Objects created with NewObject in Editor don't show in scene hierarchy

**URL:** <https://forums.unrealengine.com/t/objects-created-with-newobject-in-editor-dont-show-in-scene-hierarchy/479985>\
**Category:** C++\
**Tags:** hierarchy, unreal-engine, editor, question, CPP\
**Created:** [March 9, 2021, 3:06pm UTC](https://forums.unrealengine.com/t/objects-created-with-newobject-in-editor-dont-show-in-scene-hierarchy/479985 "2021-03-09T15:06:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverNilsson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OliverNilsson](https://forums.unrealengine.com/u/OliverNilsson)\
**Post date:** [March 9, 2021, 3:06pm UTC](https://forums.unrealengine.com/t/objects-created-with-newobject-in-editor-dont-show-in-scene-hierarchy/479985/1 "2021-03-09T15:06:34Z")

</div>

I want to be able to spawn in an amount of objects in the Editor, I wrote this code:

```
#if WITH_EDITOR
void AMyActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
	for (int i = components.Num(); i < amount; i++)
	{
		FString a = "Object" + FString::FromInt(i);
		const TCHAR* n = *a;
		tempComp = NewObject<USceneComponent>(this, USceneComponent::StaticClass(), n, 
            RF_Standalone);
		tempComp->RegisterComponent();
		tempComp->AttachTo(RootComponent);
		components.Add(tempComp);
	}
}

#endif

```

It kinda works as I want to, however the objects created don’t show up in the scene hierarchy until I press the “Play” button.

Like this:

![331902-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/9/6c999aad87a96fd9b83354a0d01e0bffd4cdd19f.png)

After I press play the object shows up correctly:

![331903-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/7/a470bbe575a4905140252bc6b6bdf337ed874948.png)

Is it possible to make this object show up here without needing to press play?
