# GameObjectUtility

> GameObject utility functions.

## Definition

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

```csharp
public sealed class GameObjectUtility
```

## Static Methods

| Method                                                                                                                                                                        | Description                                                                                                                                                                                                |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AreStaticEditorFlagsSet](/engine/6000.0/script-reference/unityeditor/gameobjectutility/arestaticeditorflagsset.md)                                                           | Returns true if the passed in StaticEditorFlags are set on the GameObject specified.                                                                                                                       |
| [DuplicateGameObject](/engine/6000.0/script-reference/unityeditor/gameobjectutility/duplicategameobject.md)                                                                   | Duplicates a single GameObject and returns the new GameObject.                                                                                                                                             |
| [DuplicateGameObjects](/engine/6000.0/script-reference/unityeditor/gameobjectutility/duplicategameobjects.md)                                                                 | Duplicates an array of GameObjects and returns the array of the new GameObject roots.                                                                                                                      |
| [EnsureUniqueNameForSibling](/engine/6000.0/script-reference/unityeditor/gameobjectutility/ensureuniquenameforsibling.md)                                                     | 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.                                            |
| [GetMonoBehavioursWithMissingScriptCount](/engine/6000.0/script-reference/unityeditor/gameobjectutility/getmonobehaviourswithmissingscriptcount.md)                           | Gets the number of MonoBehaviours with a missing script for the given GameObject.                                                                                                                          |
| [GetStaticEditorFlags](/engine/6000.0/script-reference/unityeditor/gameobjectutility/getstaticeditorflags.md)                                                                 | Gets the StaticEditorFlags of the GameObject specified.                                                                                                                                                    |
| [GetUniqueNameForSibling](/engine/6000.0/script-reference/unityeditor/gameobjectutility/getuniquenameforsibling.md)                                                           | You can use this method before instantiating a new sibling, or before parenting one GameObject to another, to ensure the new child GameObject has a unique name compared to its siblings in the hierarchy. |
| [ModifyMaskIfGameObjectIsHiddenForPrefabModeInContext](/engine/6000.0/script-reference/unityeditor/gameobjectutility/modifymaskifgameobjectishiddenforprefabmodeincontext.md) | Use this method if a custom scene culling mask is needed for renderers that should be shown or hidden in a Scene view when Prefab Mode in Context is active.                                               |
| [RemoveMonoBehavioursWithMissingScript](/engine/6000.0/script-reference/unityeditor/gameobjectutility/removemonobehaviourswithmissingscript.md)                               | Removes the MonoBehaviours with a missing script from the given GameObject.                                                                                                                                |
| [SetParentAndAlign](/engine/6000.0/script-reference/unityeditor/gameobjectutility/setparentandalign.md)                                                                       | Sets the parent and gives the child the same layer and position.                                                                                                                                           |
| [SetStaticEditorFlags](/engine/6000.0/script-reference/unityeditor/gameobjectutility/setstaticeditorflags.md)                                                                 | Sets the StaticEditorFlags of the specified GameObject.                                                                                                                                                    |
