# How to get a list of all children/attached actors?

**URL:** <https://forums.unrealengine.com/t/how-to-get-a-list-of-all-children-attached-actors/374902>\
**Category:** C++\
**Tags:** child, child-actors, unreal-engine, UE4, CPP, question\
**Created:** [October 30, 2016, 7:59pm UTC](https://forums.unrealengine.com/t/how-to-get-a-list-of-all-children-attached-actors/374902 "2016-10-30T19:59:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmCurrahee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IAmCurrahee](https://forums.unrealengine.com/u/IAmCurrahee)\
**Post date:** [October 30, 2016, 7:59pm UTC](https://forums.unrealengine.com/t/how-to-get-a-list-of-all-children-attached-actors/374902/1 "2016-10-30T19:59:13Z")

</div>

I’m currently struggling with what appears to be a simple problem. I’m trying to find a list of all children of a given actor. This is what I’m currently doing:

```
     TArray< AActor* > tempChildActors;
      AActor* owner = GetOwner();
      owner->GetAllChildActors( tempChildActors, true );
    
      uint32 count = tempChildActors.Num();

```

However, the count is still 0. I’m wondering if I’m making some incorrect assumptions. My current setup is that I have a component on a parent actor. In this component, I’m calling the above code to retrieve the parent’s child actors. Here is a picture of the child actors parented.

![113034-childobjects.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/4/5048e370af477aefb5bf2bfe2e8f79319cf090a5.png)

I feel like I might be missing something very simple here, but I just can’t seem to figure it out.

---

<div class="post-metadata">

**Author:** ![AAcnirak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AAcnirak](https://forums.unrealengine.com/u/AAcnirak)\
**Post date:** [November 7, 2017, 10:51am UTC](https://forums.unrealengine.com/t/how-to-get-a-list-of-all-children-attached-actors/374902/2 "2017-11-07T10:51:41Z")

</div>

Hi , i see it is a bit late , but i am writing to help newcomers;  
you have to use GetAttachedActors() for these ,  
childactor is component actor of an actor.  
You may want to read this post too:

> **[How to get child actors?](https://forums.unrealengine.com/questions/137336/how-to-get-child-actors.html)**
>
> Hi, what I am trying to do: Get all the child actors from an actor. Example: -\>Parent Actor Child Actor 1 Child Actor 2 Child Actor 3 After I got the child actors from the Parent Actor I want to attach them to different Actor. The...

---

<div class="post-metadata">

**Author:** ![Khubur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/khubur/32/1098129_2.png) [@Khubur](https://forums.unrealengine.com/u/Khubur)\
**Post date:** [August 2, 2021, 9:24pm UTC](https://forums.unrealengine.com/t/how-to-get-a-list-of-all-children-attached-actors/374902/3 "2021-08-02T21:24:48Z")

</div>

All you need is to call **AActor::GetAttachedActors**.

See the doc: [AActor::GetAttachedActors | Unreal Engine Documentation](https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/GameFramework/AActor/GetAttachedActors/)

E.g

```
TArray<AActor*> AttachedActors; 
GetAttachedActors(AttachedActors); 
for (auto* Attached : AttachedActors)
{    
   Attached->Destroy();
}
```

---

<div class="post-metadata">

**Author:** ![Saishy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Saishy](https://forums.unrealengine.com/u/Saishy)\
**Post date:** [November 24, 2021, 9:16pm UTC](https://forums.unrealengine.com/t/how-to-get-a-list-of-all-children-attached-actors/374902/4 "2021-11-24T21:16:36Z")

</div>

This is empty at runtime.
