> For the complete documentation index, see [llms.txt](https://unfinishedstudios1.gitbook.io/fp-motion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unfinishedstudios1.gitbook.io/fp-motion/components/motion-effects/lean.md).

# Lean

> Leaning means to be in or move into a sloping position.

## Description

What this component does is **tilt and move** the object into a position where it looks like it's leaning; again, as with most of these components, the main objects that would use something like this are the player’s camera and guns!

{% hint style="info" %}
This effect, just like any other in the asset, is something you can remove from the player, this way no matter whether your game has leaning, the asset is still for you!
{% endhint %}

Not all first-person games have this feature, but as it becomes more popular, it is important to get right.

## How does it work?

The effect works its magic as soon as the player presses one of the ‘leaning’ inputs (those being 'q' and 'e’ in the asset).

Every frame, the component checks for the player’s leaning input, when there is any, the object it’s on receives a position-force in the form of the similarly named `position` variable, and a rotation force from the `rotation`.

The script then takes the value of the `lean` axis and multiplies it by those forces and the [State Data](/fp-motion/data/state-data.md) multiplier for this component; the final effect makes the object smoothly transition from one side to the other based on player input.

## Tweaking the effect

There are two variables that you can change when trying to alter this effect, the two of them are forces that apply to the position and rotation of the object accordingly.

{% hint style="info" %}
The [State Data](/fp-motion/data/state-data.md) for the player’s current state has a multiplier for this effect.

Based on whether the `position` and `rotation` values are positive or negative, the leaning can be in reverse.
{% endhint %}
