# EnsureUniqueNameForSibling(GameObject)

> You can use this method after parenting one GameObject to another to ensure the child GameObject has a unique name compared to its siblings in the hierarchy.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.3/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void EnsureUniqueNameForSibling(GameObject self)
```

### Parameters

**** (\[GameObject]\(/engine/6000.3/script-reference/unityengine/gameobject)): The GameObject whose name you want to ensure is unique.

### Remarks

If the GameObject already has a unique name compared to its siblings, its name will remain unchanged. If the GameObject has the same name as one of its siblings, Unity will rename it to a unique name by using an incremental number after the GameObject’s current name. This is useful when trying to avoid duplicate naming.

Additional Resources: [GameObjectUtility.GetUniqueNameForSibling](/engine/6000.3/script-reference/unityeditor/gameobjectutility/getuniquenameforsibling.md), [ObjectNames.GetUniqueName](/engine/6000.3/script-reference/unityeditor/objectnames/getuniquename.md).
