# GetChildEntities(Allocator)

> Gets all child entities.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public NativeArray<Entity> GetChildEntities(Allocator allocator)
```

### Parameters

**** (\[Allocator]\(/engine/7000.0/script-reference/unity/collections/allocator)): The allocator to use for the returned array.

### Returns

| Type                                                                                      | Description                                         |
| ----------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [NativeArray\<Entity>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | A NativeArray containing all direct child entities. |

### Remarks

This fetches all children in a single call.

The caller is responsible for disposing the returned NativeArray.

Usage:

using (var children = transformRef.GetChildEntities(Allocator.Temp)) \{ foreach (Entity child in children) \{ // Process child } }
