# TryInstantiate

> Creates a new instance of the specified T.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Properties](/engine/6000.5/script-reference/unity/properties.md)
* **Assembly:** UnityEngine.PropertiesModule

## TryInstantiate\<T>(T)

Creates a new instance of the specified `T`.

```csharp
public static bool TryInstantiate<T>(out T instance)
```

### Parameters

**** (T): When this method returns, contains the created instance, if type instantiation succeeded; otherwise, the default value for `T`.

### Returns

| Type                                                          | Description                                                           |
| ------------------------------------------------------------- | --------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if a new instance of type `T` was created; otherwise, `false`. |

## TryInstantiate\<T>(Type, T)

Tries to create a new instance of the given type type and returns it as `T`.

```csharp
public static bool TryInstantiate<T>(Type derivedType, out T value)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The type we want to create a new instance of.**** (T): When this method returns, contains the created instance, if type instantiation succeeded; otherwise, the default value for `T`.

### Returns

| Type                                                          | Description                                                  |
| ------------------------------------------------------------- | ------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if a new instance of the given type could be created. |
