# IVariableCondition

> Interface for the built-in condition that compares a graph variable against a constant value.

## Definition

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

```csharp
public interface IVariableCondition : ICondition
```

## Remarks

A variable condition records the variable to compare, the comparison operator, and the constant value to compare against; it does not evaluate them. When traversing a transition's condition tree with [IGroupCondition.Get](/engine/6000.7/script-reference/unity/graphtoolkit/editor/igroupcondition/get.md), test each element for this interface to read variable conditions. [IVariableCondition.Variable](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablecondition/variable.md) and [IVariableCondition.Value](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablecondition/value.md) are `null` when no variable is assigned to the condition or when the assigned variable was deleted from the graph. This interface is implemented by Unity and is not intended to be implemented by user code.

## Properties

| Property                                                                                                 | Description                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Comparison](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablecondition/comparison.md) | The comparison operator applied between the variable and [IVariableCondition.Value](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablecondition/value.md). |
| [Value](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablecondition/value.md)           | The constant value the variable is compared against, boxed as [Object](/engine/6000.7/script-reference/unityengine/object.md), or `null` when no variable is assigned.      |
| [Variable](/engine/6000.7/script-reference/unity/graphtoolkit/editor/ivariablecondition/variable.md)     | The variable the condition compares, or `null` when no variable is assigned or the variable was deleted from the graph.                                                     |

## Inheritance

**Inherited Members:**

* [ICondition.ID()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/icondition/id.md)
* [ICondition.Rule()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/icondition/rule.md)
* [ICondition.Icon()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/icondition/icon.md)
