Method InstantiateAsync
InstantiateAsync(Vector3, Quaternion, Transform)
Instantiates the referenced asset as a GameObject at the specified position and rotation, with an optional parent.
Declaration
public virtual AsyncOperationHandle<GameObject> InstantiateAsync(Vector3 position, Quaternion rotation, Transform parent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | Position of the instantiated object. |
| Quaternion | rotation | Rotation of the instantiated object. |
| Transform | parent | The parent of the instantiated object. |
Returns
| Type | Description |
|---|---|
| AsyncOperationHandle<GameObject> | The handle for the operation. |
Remarks
You can't use this again until you release the first load. If you want to call load multiple times
on an AssetReference, use Addressables.InstantiateAsync and pass the AssetReference in as the key.
Refer to the Loading Addressable Assets documentation for more details.
InstantiateAsync(Transform, bool)
Instantiates the referenced asset as a GameObject with an optional parent and world space option.
Declaration
public virtual AsyncOperationHandle<GameObject> InstantiateAsync(Transform parent = null, bool instantiateInWorldSpace = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | parent | The parent of the instantiated object. |
| bool | instantiateInWorldSpace | Option to retain world space when instantiated with a parent. |
Returns
| Type | Description |
|---|---|
| AsyncOperationHandle<GameObject> | The handle for the operation. |
Remarks
You can't use this again until you release the first load. If you want to call load multiple times
on an AssetReference, use Addressables.InstantiateAsync and pass the AssetReference in as the key.
Refer to the Loading Addressable Assets documentation for more details.