# Move(int, int, int, bool)

> Moves an item by ID, to a new parent and child index.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public virtual void Move(int id, int newParentId, int childIndex = -1, bool rebuildTree = true)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the item to move.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The new parent ID. -1 if moved at the root.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The child index to insert at under the parent. -1 will add as the last child.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether we need to rebuild tree data. Set to false when doing multiple operations.
