# Interpolate

## Overview

![The Interpolate Node.](https://926825830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKQhJdUBr7YQzfIwmpAZ9%2Fuploads%2Fgit-blob-6253c433f5b36c0f22481bde00a1c547a80349f0%2Fnode-interpolate2.png?alt=media)

The **Interpolate** **Node** calculates intermediate values between an initial and a target value over a set amount of time. It is particularly useful for animations.

[**Scope**](https://docs.incari.com/incari-studio/2022.1/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The Interpolate Node Attributes.](https://926825830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKQhJdUBr7YQzfIwmpAZ9%2Fuploads%2Fgit-blob-035455c2de85d9be864187dcff970d2bc25eadca%2Fnode-interpolate2-attr.png?alt=media)

### Inputs

| Attribute           | Type                                         | Description                                                                                                                |
| ------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `Data Type`         | **Drop-down**                                | The numerical data type which will be interpolated.                                                                        |
| `Duration (s)`      | **Float**                                    | The length of time between the start and end of the interpolation, if it is not provided in the `Duration (s)` **Socket**. |
| `Interval Time (s)` | **Float**                                    | How frequently the interpolated value is updated and the output **Pulse** is triggered.                                    |
| `From`              | *Defined in the `Data Type`* ***Attribute*** | The value at the start of the interpolation, if one is not provided in the `From` **Socket**.                              |
| `To`                | *Defined in the `Data Type`* ***Attribute*** | The value at the end of the interpolation, if one is not provided in the `To` **Socket**.                                  |

### Interpolation

| Attribute  | Type                                      | Description                                                                                                    |
| ---------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `Type`     | **Drop-down**                             | Method used for calculating the intermediate values.                                                           |
| `Mode`     | **Drop-down**                             | Whether the interpolation will be performed once, repeated or alternated.                                      |
| `Count`    | **Int** (*not available for `Mode` Once*) | The number of times that the interpolation will be performed, if it is not provided in the `Count` **Socket**. |
| `Infinite` | **Bool**                                  | Whether the interpolation will be played indefinitely (this overrides the `Count` **Attribute**).              |

## Inputs

| Input          | Type                                         | Description                                                        |
| -------------- | -------------------------------------------- | ------------------------------------------------------------------ |
| `Instance ID`  | **InstanceID**                               | The assigned **Instance** of an **Animation Block**.               |
| `Start`        | **Pulse**                                    | **Pulse** to trigger the start of the interpolation.               |
| `Duration (s)` | **Float**                                    | The length of time between the start and end of the interpolation. |
| `Count`        | **Int**                                      | The number of times that the interpolation will be performed.      |
| `From`         | *Defined in the `Data Type`* ***Attribute*** | The value at the start of the interpolation.                       |
| `To`           | *Defined in the `Data Type`* ***Attribute*** | The value at the end of the interpolation.                         |
| `Reset`        | **Pulse**                                    | **Pulse** to reset the interpolation.                              |

## Outputs

| Output             | Type                                         | Description                                                                                                                            |
| ------------------ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse**                                    | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Instance ID`      | **InstanceID**                               | The previously assigned **Instance** of the **Animation Block**.                                                                       |
| `Value`            | *Defined in the `Data Type`* ***Attribute*** | The intermediate value calculated.                                                                                                     |
| `OnStart`          | **Pulse**                                    | **Pulse** that gets triggered when the interpolation starts.                                                                           |
| `OnReset`          | **Pulse**                                    | **Pulse** that gets triggered when the interpolation resets.                                                                           |
| `OnEnd`            | **Pulse**                                    | **Pulse** that gets triggered when the interpolation ends.                                                                             |

## See Also

* [**4 Methods of Animation - Interpolation**](https://docs.incari.com/incari-studio/2022.1/demo-projects/4-methods-of-animation#2-interpolation)
* [**Play Animation**](https://docs.incari.com/incari-studio/2022.1/toolbox/incari/animation/playanimation)

## External Links

* [*How to use Interpolation Node? part A | Incari Studio Tutorial*](https://www.youtube.com/watch?v=StFmsERQJTs) on Youtube.
* [*How to use Interpolation Node? part B | Incari Studio Tutorial*](https://www.youtube.com/watch?v=v-xG_oa0tLI) on Youtube.
