> 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/roll.md).

# Roll

> To roll is to move in a particular direction by turning over and over on an axis.

## Description

This motion effect recreates the **rotation** changes in the walking animations that a lot of first-person games have for their camera and guns.

This component makes the object it's placed on rotate as the player moves, simulating a 'rolling' movement, we normally use it together with the Bob script to complete the walking animation look.

## How does it work?

The way this component produces the rolling effect is by using the values produced from an infinite [sine wave](https://en.wikipedia.org/wiki/Sine_wave) and then multiplying those by the player's input (to only produce the effect while moving), and the [State Data's](/fp-motion/data/state-data.md) current state's multiplier for this component.

Once it finishes calculating the values, it then applies them to the object trough the [Handle](/fp-motion/components/untitled.md) using the [Spring System](/fp-motion/components/spring-system.md) to calculate the new rotation based on them.

## Tweaking the effect

When changing the rolling effect, there is one very important variable, and that is the `wave` field. As the value is of the [Wave Data](/fp-motion/data/wave-data.md) type, the values you can change are the `amplitude` and the `rate`, which tell the component how to rotate, and how fast to do it.

It is also very important to keep in mind that this component **has a state multiplier**, and thus the value from it can also affect the result.

Another important point to keep in mind is the [Spring Data](/fp-motion/data/spring-data.md) that every [Motion Effect](/fp-motion/components/motion-effects.md) has, which can change how the effect looks entirely.

{% hint style="info" %}
The `amplitude` value determines not only how much the object gets rotated but also on what axis it does so; changing one axis to have a value of zero will make the object not rotate in that direction.
{% endhint %}
