# TrySetDefaultValue<T>(T)

> Sets the default value of the variable.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
bool TrySetDefaultValue<T>(T value)
```

### Parameters

**** (T): The default value to set.

### Returns

| Type                                                          | Description                                                           |
| ------------------------------------------------------------- | --------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if the default value was successfully set; otherwise, `false`. |

### Remarks

The default value must be of a type compatible with the variable's [IVariable.DataType](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariable/datatype.md).
