# Actor viewport spawned actors not updating

**URL:** <https://forums.unrealengine.com/t/actor-viewport-spawned-actors-not-updating/360269>\
**Category:** C++\
**Tags:** construction, spawning, unreal-engine, construction-script, CPP, question\
**Created:** [June 10, 2016, 2:39am UTC](https://forums.unrealengine.com/t/actor-viewport-spawned-actors-not-updating/360269 "2016-06-10T02:39:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PantherNZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PantherNZ](https://forums.unrealengine.com/u/PantherNZ)\
**Post date:** [June 10, 2016, 2:39am UTC](https://forums.unrealengine.com/t/actor-viewport-spawned-actors-not-updating/360269/1 "2016-06-10T02:39:19Z")

</div>

Hey there, I have a bunch of child actor components that are spawned in C++ from the construction script. My code is as follows:

```
.h
UPROPERTY( Transient ) TArray< UChildActorComponent > SpawnedChildObstacles;
.cpp
    UChildActorComponent* NewComponent = NewObject< UChildActorComponent >( this );
     if( NewComponent )
     {
         NewComponent->SetChildActorClass( Class );
         NewComponent->AttachTo( RootComponent );
         NewComponent->RegisterComponent();
         NewComponent->bCreatedByConstructionScript_DEPRECATED = true;
         SpawnedChildObstacles.Add( NewComponent );
     }

```

I clear my vector when I spawn the new UChildActorComponents. For some reason when I move the parent object around (causing my construction script to be called) it does not remove the previous UChildActorComponents.  
The strange thing is that if I close the parent blueprint and reopen it, the old ones are removed and everything is fine!
