# ChangeGameObjectParentEventArgs

> A change of this type indicates that the parent of a GameObject has changed. This happens when Undo.SetTransformParent or SceneManager.MoveGameObjectToScene is used.

## Definition

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

```csharp
public struct ChangeGameObjectParentEventArgs
```

## Constructors

| Constructor                                                                                                                                                                                                                        | Description                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| [ChangeGameObjectParentEventArgs(System.Int32,UnityEngine.SceneManagement.Scene,System.Int32,UnityEngine.SceneManagement.Scene,System.Int32)](/engine/6000.0/script-reference/unityeditor/changegameobjectparenteventargs/ctor.md) | Constructs a new instance. |

## Properties

| Property                                                                                                                            | Description                                                                                                                                                                                                                                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [instanceId](/engine/6000.0/script-reference/unityeditor/changegameobjectparenteventargs/instanceid.md)                             | The instance ID of the [GameObject](/engine/6000.0/script-reference/unityengine/gameobject.md) whose parent changed. Note that this is not the instance ID of the [Transform](/engine/6000.0/script-reference/unityengine/transform.md) component.                                |
| [newParentInstanceId](/engine/6000.0/script-reference/unityeditor/changegameobjectparenteventargs/newparentinstanceid.md)           | The instance ID of the [GameObject](/engine/6000.0/script-reference/unityengine/gameobject.md) that is the new parent of the target. Note that this is not the instance ID of its [Transform](/engine/6000.0/script-reference/unityengine/transform.md).                          |
| [newScene](/engine/6000.0/script-reference/unityeditor/changegameobjectparenteventargs/newscene.md)                                 | The [Scene](/engine/6000.0/script-reference/unityeditor/searchservice/scene.md) containing the new parent. This is useful to detect whether a [GameObject](/engine/6000.0/script-reference/unityengine/gameobject.md) was moved to another scene or moved to the root of a scene. |
| [previousParentInstanceId](/engine/6000.0/script-reference/unityeditor/changegameobjectparenteventargs/previousparentinstanceid.md) | The instance ID of the [GameObject](/engine/6000.0/script-reference/unityengine/gameobject.md) that was the previous parent of the target. Note that this is not the instance ID of its [Transform](/engine/6000.0/script-reference/unityengine/transform.md).                    |
| [previousScene](/engine/6000.0/script-reference/unityeditor/changegameobjectparenteventargs/previousscene.md)                       | The scene containing the previous parent. This is useful to detect whether a [GameObject](/engine/6000.0/script-reference/unityengine/gameobject.md) was moved to another scene.                                                                                                  |
