# TrySetValue<T>(T)

> Sets a new value for the node option.

## Definition

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

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

### Parameters

**** (T): The value to assign to the option’s UI field.

### Returns

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

### Remarks

This method allows for editor-time modification of a node option's value. It performs a type check and conversion internally. If the value cannot be cast to [INodeOption.DataType](/engine/6000.6/script-reference/unity/graphtoolkit/editor/inodeoption/datatype.md), the method returns `false`. This method triggers the [Node.DefineNode](/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/definenode.md) method to update the node visual.
