# ScaleTo Action

## Overview

![The ScaleTo Node.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-d071e055b45b81a91701b2a91ab9e2f1623ffa9b%2Fscaletoactionnode20241.png?alt=media)

The **ScaleTo Action Node** continuously scales an [**Object**](https://docs.incari.com/incari-studio/objects-and-types/scene-objects) to the `Scale` values specified in `To` for a given period of time, thus creating an **Animation**. Find an [example](#example) of how to use this **Node** and its effect over an **Object** at the end of this page.

Furthermore, visit the [**Actions Nodes**](https://docs.incari.com/incari-studio/toolbox/actions) page for a general introduction to these **Nodes**, and [**Scale**](https://docs.incari.com/incari-studio/objects-and-types/attributes/common-attributes/transformation#scale) for more detail about the `Scale` **Attribute**.

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

## Attributes

![The ScaleTo Node Attributes.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-ab7360426751b3ffc3d16e357f4981ec2fbf7adc%2Fscaletoactionatts20241.png?alt=media)

| Attribute        | Type          | Description                                                                                                                                                                                                                                                                                                                              |
| ---------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `To`             | **Vector3**   | The desired final `Scale` values along the X, Y, Z axes, if none are given in the `To` **Input Socket**.                                                                                                                                                                                                                                 |
| `Duration (sec)` | **Float**     | The total time of the **Action**, if none is given in the `Duration` **Input Socket**.                                                                                                                                                                                                                                                   |
| `Interpolation`  | **Drop-down** | The `Interpolation` method to use for calculating the intermediate values of the `Scale`. It can be [*Linear*](https://en.wikipedia.org/wiki/Linear_interpolation), [*Sine Ease In*](https://easings.net/#easeInSine), [*Sine Ease In Out*](https://easings.net/#easeInOutSine), or [*Sine Ease Out*](https://easings.net/#easeOutSine). |

## Inputs

| Input         | Type           | Description                                                                                                                                                                                        |
| ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Instance ID` | **InstanceID** | The assigned [**Instance ID**](https://docs.incari.com/incari-studio/toolbox/actions/..#instance-id) of the **Action**. If nothing is received, it automatically assigns 0 as the **Instance ID**. |
| (►) `Start`   | **Pulse**      | A standard **Input Pulse**, to trigger the execution of the **Node**.                                                                                                                              |
| `Object ID`   | **ObjectID**   | The ID of the target **Object**.                                                                                                                                                                   |
| `Duration`    | **Float**      | The total time (in seconds).                                                                                                                                                                       |
| `To`          | **Vector3**    | The desired final `Scale` values along the X, Y, Z axes.                                                                                                                                           |

## Outputs

| Output        | Type           | Description                                                                                                             |
| ------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `Instance ID` | **InstanceID** | The assigned [**Instance ID**](https://docs.incari.com/incari-studio/toolbox/actions/..#instance-id) of the **Action**. |
| `OnStart` (►) | **Pulse**      | Flows to the next **Node** following **ScaleTo Action** when the **Action** starts.                                     |
| `OnEnd` (►)   | **Pulse**      | Flows to the next **Node** following **ScaleTo Action** when the **Action** stops.                                      |

## Example

This section shows a simple example of how to use the **ScaleTo Action** **Node** and the effect it has on an **Object**. We start by [configuring the **Scene**](#scene-configuration), then [build the **Logic**](#logic), and finally show the [result](#final-result).

### Scene Configuration

We consider a [**Scene**](https://docs.incari.com/incari-studio/objects-and-types/project-objects/scene) with two [**Objects**](https://docs.incari.com/incari-studio/objects-and-types/scene-objects): a red ellipse over a black background, both of which can be easily created in the [**Scene Outliner**](https://docs.incari.com/incari-studio/modules/scene-outliner). Then, we set the `Size` **Attribute** of the ellipse to $$(1000, 1000, 0)$$ and its `Scale` **Attribute** to $$(0.1, 0.1, 0)$$. See this configuration in the following image:

![Scene configuration.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-2a6217e166569b1e34e3dbe1265d5f7c64cbba4b%2FExampleScaleTo_1.png?alt=media)

### Logic

We then need to configure the **Logic**. This is done in the [**Logic Editor**](https://docs.incari.com/incari-studio/modules/logic-editor).

We use the **ScaleTo Action** **Node** with the following **Attributes**:

* `To`: $$(0.4, 0.4, 0)$$
* `Duration (sec)`: $$4$$
* `Interpolation`: `Linear`

And we connect to it the [**Object Node**](https://docs.incari.com/incari-studio/objects-and-types/scene-objects#objects-in-the-logic) of the red ellipse and a **Pulse** to the `Start` **Input Socket**. Thus, having the following **Logic** configuration:

![Logic configuration.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-429dd1945536bd17058de41f326ce67a064bdedf%2FExampleScaleTo_2.png?alt=media)

### Final result

Finally, the effect of the **ScaleTo Action** **Node** when triggered is the following:

![Final result.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-a34eddb3bb4fc4fe8735d915405518f4d5a5ed06%2FExampleScaleTo_3cr.gif?alt=media)

## See Also

* [**ScaleBy**](https://docs.incari.com/incari-studio/toolbox/actions/scalebyaction)

## External Links

* [*Scaling (geometry)*](https://en.wikipedia.org/wiki/Scaling_\(geometry\)) on Wikipedia.
