# Handle

## Description

The *Handle* is a class that acts as the [Spring System](https://unfinishedstudios1.gitbook.io/fp-motion/components/spring-system) for an object, meaning that it takes forces and then moves, rotates and scales the object you create it for; we give its value when subscribing an object to the [Motion Manager](https://unfinishedstudios1.gitbook.io/fp-motion/components/motion-manager) and can be **used to add forces** to the object.

To subscribe an object to the *Motion Manager*, we have to invoke the subscribe method, and pass a Spring Data value for each property we want to change (position, rotation or scale).

{% hint style="info" %}
If you wish to know more about subscribing objects, you can check out the [Motion Manager](https://unfinishedstudios1.gitbook.io/fp-motion/components/motion-manager).
{% endhint %}

## How does it work?

The way this component works is by taking forces we apply to it, and then add them together with the [Spring Data](https://unfinishedstudios1.gitbook.io/fp-motion/data/spring-data) values for the correct property, finally it applies the results to the correct game-object. The *Handle* itself does not have an update method, and thus the *Motion Manager* is in-charge of invoking all the handles’ updates.

{% hint style="info" %}
To give you more control over how the forces you apply affect the object, we use the *Spring Data* class, this class will allow you to change how different forces you apply affect the object.
{% endhint %}

## Usage

Once you subscribe an object to the *Motion Manager* trough a component, that component gains access to a *Handle*, this can now be **used to translate, rotate or even scale** the object in question.

You can move an object every frame by using the following code:

```csharp
private void Update() {
    //Keeps the spring stretching by one unit.
    handle.Translate(Vector3.up);
}
```

{% hint style="info" %}
The final position of the object in this case will not be one unit on the Y axis, as the spring is pulling it towards the rest position, thus the **outcome will vary** based on the settings used.
{% endhint %}
