# InstantiateAsync

> Captures a snapshot of the original object that's related to another GameObject and obtains an AsyncInstantiateOperation instance of the resulting objects.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## InstantiateAsync\<T>(T)

Captures a snapshot of the original object that's related to another GameObject and obtains an AsyncInstantiateOperation instance of the resulting objects.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

### Remarks

The operation is mainly asynchronous, but the last stage involving integration and awake calls is executed on the main thread. The operation can be cancelled, or the integration stage can be delayed using allowSceneActivation.

It is possible to yield a return operation or call its WaitForCompletion() method to finish the operation in a synchronized way.

For extra control you can use the overrides that take an [InstantiateParameters](/engine/6000.0/script-reference/unityengine/instantiateparameters.md) struct. This includes extra options like deciding between using local or world space, or to specify a target scene for the objects.

## InstantiateAsync\<T>(T, Transform)

Clones the object of type T asynchronously, sets `parent` as the parent of the clone, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, Transform parent) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, Vector3, Quaternion)

Clones the object of type T asynchronously, sets the position and rotation of the clone, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, Vector3 position, Quaternion rotation) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)

Clones the object of type T asynchronously, sets the parent, position, and rotation of the clone, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, Transform parent, Vector3 position, Quaternion rotation) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int)

Clones the object of type T asynchronously, creates a specified number of copies, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Transform)

Clones the object of type T asynchronously, creates a specified number of copies, sets `parent` as the parent of the clones, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Transform parent) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Vector3, Quaternion)

Clones the object of type T asynchronously, creates a specified number of copies, sets the position and rotation of the clones, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Vector3 position, Quaternion rotation) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)

Clones the object of type T asynchronously, creates a specified number of copies, sets the per-copy positions and rotations of the clones, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, ReadOnlySpan<Vector3> positions, ReadOnlySpan<Quaternion> rotations) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[ReadOnlySpan\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of positions for the new object or objects. The length of the span can be less than `count`, in which case Unity uses positions\[i % positions.Length].**** (\[ReadOnlySpan\<Quaternion>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of rotations for the new object or objects. The length of the span can be less than `count`, in which case Unity uses rotations\[i % rotations.Length].

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)

Clones the object of type T asynchronously, creates a specified number of copies, sets the parent, position, and rotation of the clones, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Transform parent, Vector3 position, Quaternion rotation) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)

Clones the object of type T asynchronously, creates a specified number of copies, sets the parent, position, and rotation of the clones, and returns an `AsyncInstantiateOperation` that you can cancel with `cancellationToken`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Transform parent, Vector3 position, Quaternion rotation, CancellationToken cancellationToken) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)

Clones the object of type T asynchronously, creates a specified number of copies, sets the parent and the per-copy positions and rotations of the clones, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Transform parent, ReadOnlySpan<Vector3> positions, ReadOnlySpan<Quaternion> rotations) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.**** (\[ReadOnlySpan\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of positions for the new object or objects. The length of the span can be less than `count`, in which case Unity uses positions\[i % positions.Length].**** (\[ReadOnlySpan\<Quaternion>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of rotations for the new object or objects. The length of the span can be less than `count`, in which case Unity uses rotations\[i % rotations.Length].

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)

Clones the object of type T asynchronously, creates a specified number of copies, sets the parent and the per-copy positions and rotations of the clones, and returns an `AsyncInstantiateOperation` that you can cancel with `cancellationToken`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Transform parent, ReadOnlySpan<Vector3> positions, ReadOnlySpan<Quaternion> rotations, CancellationToken cancellationToken) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Transform]\(/engine/6000.0/script-reference/unityengine/transform)): The [Transform](/engine/6000.0/script-reference/unityengine/transform.md) to set as the parent of the new object.**** (\[ReadOnlySpan\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of positions for the new object or objects. The length of the span can be less than `count`, in which case Unity uses positions\[i % positions.Length].**** (\[ReadOnlySpan\<Quaternion>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of rotations for the new object or objects. The length of the span can be less than `count`, in which case Unity uses rotations\[i % rotations.Length].**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)

Clones the object of type T asynchronously, applies the settings in `parameters`, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, InstantiateParameters parameters, CancellationToken cancellationToken = default) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[InstantiateParameters]\(/engine/6000.0/script-reference/unityengine/instantiateparameters)): An [InstantiateParameters](/engine/6000.0/script-reference/unityengine/instantiateparameters.md) struct that specifies options for the new object, such as its parent, the scene to add it to, and whether to use world space.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)

Clones the object of type T asynchronously, creates a specified number of copies, applies the settings in `parameters`, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, InstantiateParameters parameters, CancellationToken cancellationToken = default) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[InstantiateParameters]\(/engine/6000.0/script-reference/unityengine/instantiateparameters)): An [InstantiateParameters](/engine/6000.0/script-reference/unityengine/instantiateparameters.md) struct that specifies options for the new object, such as its parent, the scene to add it to, and whether to use world space.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)

Clones the object of type T asynchronously, sets the position and rotation of the clone, applies the settings in `parameters`, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, Vector3 position, Quaternion rotation, InstantiateParameters parameters, CancellationToken cancellationToken = default) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.**** (\[InstantiateParameters]\(/engine/6000.0/script-reference/unityengine/instantiateparameters)): An [InstantiateParameters](/engine/6000.0/script-reference/unityengine/instantiateparameters.md) struct that specifies options for the new object, such as its parent, the scene to add it to, and whether to use world space.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)

Clones the object of type T asynchronously, creates a specified number of copies, sets the position and rotation of the clones, applies the settings in `parameters`, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, Vector3 position, Quaternion rotation, InstantiateParameters parameters, CancellationToken cancellationToken = default) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The position for the new object or objects.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation for the new object or objects.**** (\[InstantiateParameters]\(/engine/6000.0/script-reference/unityengine/instantiateparameters)): An [InstantiateParameters](/engine/6000.0/script-reference/unityengine/instantiateparameters.md) struct that specifies options for the new object, such as its parent, the scene to add it to, and whether to use world space.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |

## InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)

Clones the object of type T asynchronously, creates a specified number of copies, sets the per-copy positions and rotations of the clones, applies the settings in `parameters`, and returns an `AsyncInstantiateOperation`.

```csharp
public static AsyncInstantiateOperation<T> InstantiateAsync<T>(T original, int count, ReadOnlySpan<Vector3> positions, ReadOnlySpan<Quaternion> rotations, InstantiateParameters parameters, CancellationToken cancellationToken = default) where T : Object
```

### Parameters

**** (T): An existing object that you want to make a copy of.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of new copies to create.**** (\[ReadOnlySpan\<Vector3>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of positions for the new object or objects. The length of the span can be less than `count`, in which case Unity uses positions\[i % positions.Length].**** (\[ReadOnlySpan\<Quaternion>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The read only span of rotations for the new object or objects. The length of the span can be less than `count`, in which case Unity uses rotations\[i % rotations.Length].**** (\[InstantiateParameters]\(/engine/6000.0/script-reference/unityengine/instantiateparameters)): An [InstantiateParameters](/engine/6000.0/script-reference/unityengine/instantiateparameters.md) struct that specifies options for the new object, such as its parent, the scene to add it to, and whether to use world space.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): A token that you can use to cancel the asynchronous operation before it completes.

### Returns

| Type                                                                                                      | Description                                                    |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [AsyncInstantiateOperation\<T>](/engine/6000.0/script-reference/unityengine/asyncinstantiateoperation.md) | An asynchronous operation that contains the resulting objects. |
