# Int

## Int cast nodes

You can use an int cast node to convert in an integer value to a float or a string.

**Inputs:**

<table><thead><tr><th width="162">Name</th><th width="168">Type</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Integer</td><td>The value to be converted.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="163">Name</th><th width="169">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>&#x3C;varies> [editable]</td><td>The converted value.<br><br>The output depends on the chosen node, and is either a float or a string.</td></tr></tbody></table>

## Logic Int Changed

Outputs `true` in the frame where the input value changes.

**Inputs:**

<table><thead><tr><th width="152">Name</th><th width="160">Type</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Integer</td><td>The integer value to monitor.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="155">Name</th><th width="159">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Boolean</td><td>True when the <code>Input</code> changes, but resets to false at the end of the frame.</td></tr></tbody></table>

## Int Constant

Outputs an integer value. An AFX graph cannot change the value of this node.

{% hint style="info" %}
You can open an AFX graph to change the value of this node in the Unity Editor.
{% endhint %}

**Outputs:**

<table><thead><tr><th width="153">Name</th><th width="172">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Int [editable]</td><td>An integer number.</td></tr></tbody></table>

## Generate Random Int

Generates a random number between Min (inclusive) and Max (exclusive). For more information, refer to [Random.Range](https://docs.unity3d.com/2021.3/Documentation/ScriptReference/Random.Range.html) in the Unity documentation.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="170">Type</th><th>Description</th></tr></thead><tbody><tr><td>Enter</td><td>Flow</td><td>Flow to activate the node.</td></tr><tr><td>Min</td><td>Integer [editable]</td><td>The minimum value for the randomly generated number.</td></tr><tr><td>Max</td><td>Integer [editable]</td><td>The maximum value for the randomly generated number will be Max-1.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="170">Type</th><th>Description</th></tr></thead><tbody><tr><td>Exit</td><td>Flow</td><td>Continue the activating flow.</td></tr><tr><td>Output</td><td>Integer</td><td>The randomly generated number.</td></tr></tbody></table>

## Get Int

Converts a reference to a int component to a integer value.

**Inputs:**

<table><thead><tr><th width="182">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Int Component</td><td>Int Component</td><td>Reference to a int component.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="176">Name</th><th width="156">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Integer</td><td>The value of the int component.</td></tr></tbody></table>

## Invert Int

Inverts an integer value. Essentially changes the sign of the integer from positive to negative or from negative to positive.

**Inputs:**

<table><thead><tr><th width="159">Name</th><th width="156">Type</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Integer</td><td>The value to be inverted.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="159">Name</th><th width="156">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Integer</td><td>The inverted value of the <code>Input</code>.</td></tr></tbody></table>

## Set Int

Set the value of an int object when activated by a flow.

**Inputs:**

<table><thead><tr><th width="199">Name</th><th width="172">Type</th><th>Description</th></tr></thead><tbody><tr><td>Enter</td><td>Flow</td><td>Flow to activate the node</td></tr><tr><td>Int Component</td><td>Object</td><td>Reference to the int object for which the value will be set.</td></tr><tr><td>Value In</td><td>Integer [editable]</td><td>The value to be applied to the int component. Either the value provided to the input port or the value set in the field.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="201">Name</th><th width="172">Type</th><th>Description</th></tr></thead><tbody><tr><td>Exit</td><td>Flow</td><td>Continue the activating flow.</td></tr><tr><td>Output</td><td>Integer</td><td>Either the value provided to the <code>Value In</code> input port or the value set in the field.</td></tr></tbody></table>
