# Interpolate

## Overview

![The Interpolate Node.](/files/xlmZBelBG9FUhwsviP9K)

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**](/incari-studio/2023.2/toolbox/overview.md#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The Interpolate Node Attributes.](/files/O4rSJI77oe8NEpaTmJKD)

### 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. |

The following `Interpolation` **Attributes** are only available when `Alternate` or `Repeat` is the selected `Mode`:

| Attribute  | Type     | Description                                                                                                    |
| ---------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `Count`    | **Int**  | 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**](/incari-studio/2023.2/demo-projects/4-methods-of-animation.md#2-interpolation)
* [**Play Animation**](/incari-studio/2023.2/toolbox/incari/animation/playanimation.md)

## 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.incari.com/incari-studio/2023.2/toolbox/math/interpolate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
