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 and then multiplying those by the player's input (to only produce the effect while moving), and the State Data's current state's multiplier for this component.

Once it finishes calculating the values, it then applies them to the object trough the Handle using the Spring System 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 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 that every Motion Effect has, which can change how the effect looks entirely.

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.

Last updated

Was this helpful?