# ChangeGameObjectParentEventArgs

> Constructs a new instance.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## ChangeGameObjectParentEventArgs(EntityId, Scene, EntityId, Scene, EntityId)

Constructs a new instance.

```csharp
public ChangeGameObjectParentEventArgs(EntityId entityId, Scene previousScene, EntityId previousParentEntityId, Scene newScene, EntityId newParentEntityId)
```

### Parameters

**** (\[EntityId]\(/engine/6000.5/script-reference/unityengine/entityid)): **** (\[Scene]\(/engine/6000.5/script-reference/unityengine/scenemanagement/scene)): The scene containing the previous parent. This is useful to detect whether a [GameObject](/engine/6000.5/script-reference/unityengine/gameobject.md) was moved to another scene.**** (\[EntityId]\(/engine/6000.5/script-reference/unityengine/entityid)): **** (\[Scene]\(/engine/6000.5/script-reference/unityengine/scenemanagement/scene)): The [Scene](/engine/6000.5/script-reference/unityeditor/searchservice/scene.md) containing the new parent. This is useful to detect whether a [GameObject](/engine/6000.5/script-reference/unityengine/gameobject.md) was moved to another scene or moved to the root of a scene.**** (\[EntityId]\(/engine/6000.5/script-reference/unityengine/entityid)):&#x20;

## ChangeGameObjectParentEventArgs(int, Scene, int, Scene, int)

Constructs a new instance.

> **Warning:**
>
> **Removed.** ChangeGameObjectParentEventArgs(int instanceId, Scene previousScene, int previousParentInstanceId, Scene newScene, int newParentInstanceId) is deprecated. Use ChangeGameObjectParentEventArgs(EntityId entityId, Scene previousScene, EntityId previousParentEntityId, Scene newScene, EntityId newParentEntityId) instead.

```csharp
public ChangeGameObjectParentEventArgs(int instanceId, Scene previousScene, int previousParentInstanceId, Scene newScene, int newParentInstanceId)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The instance ID of the [GameObject](/engine/6000.5/script-reference/unityengine/gameobject.md) whose parent changed. Note that this is not the instance ID of the [Transform](/engine/6000.5/script-reference/unityengine/transform.md) component.**** (\[Scene]\(/engine/6000.5/script-reference/unityengine/scenemanagement/scene)): The scene containing the previous parent. This is useful to detect whether a [GameObject](/engine/6000.5/script-reference/unityengine/gameobject.md) was moved to another scene.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The instance ID of the [GameObject](/engine/6000.5/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.5/script-reference/unityengine/transform.md).**** (\[Scene]\(/engine/6000.5/script-reference/unityengine/scenemanagement/scene)): The [Scene](/engine/6000.5/script-reference/unityeditor/searchservice/scene.md) containing the new parent. This is useful to detect whether a [GameObject](/engine/6000.5/script-reference/unityengine/gameobject.md) was moved to another scene or moved to the root of a scene.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The instance ID of the [GameObject](/engine/6000.5/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.5/script-reference/unityengine/transform.md).
