# Add

> Adds a new node that has a specified parent node to the hierarchy.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Hierarchy](/engine/6000.5/script-reference/unity/hierarchy.md)
* **Assembly:** UnityEngine.HierarchyCoreModule

## Add(HierarchyNode, HierarchyNode)

Adds a new node that has a specified parent node to the hierarchy.

```csharp
public bool Add(in HierarchyNode parent, out HierarchyNode node)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The parent of the new node.**** (\[HierarchyNode]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The new node if the command succeeds.

### Returns

| Type                                                          | Description                                                        |
| ------------------------------------------------------------- | ------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the command was appended to the list, `false` otherwise. |

## Add(HierarchyNode, int, HierarchyNode\[])

Adds multiple new nodes that have a specified parent node to the hierarchy.

```csharp
public bool Add(in HierarchyNode parent, int count, out HierarchyNode[] nodes)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The parent of the new nodes.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of nodes to create.**** (\[HierarchyNode\[]]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The new nodes if the command succeeds.

### Returns

| Type                                                          | Description                                                        |
| ------------------------------------------------------------- | ------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the command was appended to the list, `false` otherwise. |

## Add(HierarchyNode, Span\<HierarchyNode>)

Adds multiple new nodes that have a specified parent node to the hierarchy.

```csharp
public bool Add(in HierarchyNode parent, Span<HierarchyNode> outNodes)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The parent of the new nodes.**** (\[Span\<HierarchyNode>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): The span of nodes filled with new nodes if the command succeeds.

### Returns

| Type                                                          | Description                                                        |
| ------------------------------------------------------------- | ------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the command was appended to the list, `false` otherwise. |
