# Clamp

## Overview

![The Clamp Node.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-c26772769f0fc45707315f95dab03beb37d71220%2Fclampupdatedimage.png?alt=media)

**Clamp** limits a *numerical value* to a given range, so that it isn't lower than the lower boundary, or higher than the upper boundary.

| `Value`     | `From` | `To`         | `Result`  |
| ----------- | ------ | ------------ | --------- |
| 50          | 0      | 100          | 50        |
| 120         | 0      | 100          | 100       |
| -20         | 0      | 100          | 0         |
| -270        | -180   | 180          | -180      |
| (-20, 1100) | (0, 0) | (1920, 1080) | (0, 1080) |

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

## Attributes

![The Clamp Node Attributes.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-2851c19122642950b0486118243332c4094de044%2Fnode-clamp2-attr.png?alt=media)

| Attribute   | Type                                          | Description                                                                                     |
| ----------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `Data Type` | **Drop-down**                                 | The type of data that will be plugged into the `Input` **Sockets**.                             |
| `From`      | *Defined in the `Data Type`* ***Attribute***. | The default lower boundary of the range, if there is nothing attached to the `From` **Socket**. |
| `To`        | *Defined in the `Data Type`* ***Attribute***. | The default upper boundary of the range, if there is nothing attached to the `To` **Socket**.   |

## Inputs

| Input             | Type                                          | Description                                                           |
| ----------------- | --------------------------------------------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse**                                     | A standard input **Pulse**, to trigger the execution of the **Node**. |
| `Value`           | *Defined in the `Data Type`* ***Attribute***. | The value to be clamped within the range defined in `From` and `To`.  |
| `From`            | *Defined in the `Data Type`* ***Attribute***. | The lower boundary of the range.                                      |
| `To`              | *Defined in the `Data Type`* ***Attribute***. | The upper boundary of the range.                                      |

## 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. |
| `Result`           | *Defined in the `Data Type`* ***Attribute***. | The received `Value`, restricted to fall within the boundary defined by `From` and `To`.                                               |
