# IConstantNode

> Interface for a specialized node that outputs a fixed value of a specific data type.

## Definition

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

```csharp
public interface IConstantNode : INode
```

## Remarks

Use constant nodes to represent a static, predefined value in the graph. This value remains unchanged and is typically used to feed constant input into computations. To retrieve the value, use [IConstantNode.TryGetValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iconstantnode/trygetvalue.md). This method is type-safe and provides access to the node’s value if the type matches. The [IConstantNode.DataType](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iconstantnode/datatype.md) property identifies the constant's type.

## Properties

| Property                                                                                        | Description                                 |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [DataType](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iconstantnode/datatype.md) | The data type of the constant node's value. |

## Methods

| Method                                                                                                | Description                                                             |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [TryGetValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iconstantnode/trygetvalue.md) | Retrieves the value of the constant node as the specified type.         |
| [TrySetValue](/engine/6000.7/script-reference/unity/graphtoolkit/editor/iconstantnode/trysetvalue.md) | Sets the value of the constant node to the specified value of type `T`. |

## Inheritance

**Inherited Members:**

* [INode.GetInputPort(int)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getinputport.md)
* [INode.GetInputPorts()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getinputports.md)
* [INode.GetInputPortByName(string)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getinputportbyname.md)
* [INode.GetOutputPort(int)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getoutputport.md)
* [INode.GetOutputPorts()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getoutputports.md)
* [INode.GetOutputPortByName(string)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getoutputportbyname.md)
* [INode.GetNodeOption(int)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getnodeoption.md)
* [INode.GetNodeOptionByName(string)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/getnodeoptionbyname.md)
* [INode.RemoveFromGraph()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/removefromgraph.md)
* [INode.Tooltip()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/tooltip.md)
* [INode.Title()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/title.md)
* [INode.Subtitle()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/subtitle.md)
* [INode.DefaultColor()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/defaultcolor.md)
* [INode.FillAmount()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/fillamount.md)
* [INode.IsConnected()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/isconnected.md)
* [INode.InputPortCount()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/inputportcount.md)
* [INode.ID()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/id.md)
* [INode.OutputPortCount()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/outputportcount.md)
* [INode.Position()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/position.md)
* [INode.NodeOptionCount()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/nodeoptioncount.md)
* [INode.NodeOptions()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/nodeoptions.md)
* [INode.Graph()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inode/graph.md)
