Land

To land means to come down through the air and rest on the ground or another surface.

Description

The Land component is one of the motion effects that FP Motion comes with, it makes an object move to simulate a landing whenever the player’s controller touches the ground after falling.

How does it work?

To make this component work, we subscribe a method called OnChange_GroundState() to the change event for the player’s grounding state; what this means is that the function only gets called when the player’s grounding changes, whether it be when landing, or jumping.

The method then makes sure that the player has landed and then applies a Sequence Stop to change the position and the rotation.

This component uses a Sequence Stop instead of applying forces to make the forces ‘longer’. Maintaining an effect isn’t possible without scheduling it, so the Scheduler also comes into play.

Something else that we take into account is the useVelocity field, which tells the code whether to multiply the player’s velocity at the moment of impact by the values set in the stop, or not.

Tweaking the effect

When changing the effect it’s very important to decide whether the player’s velocity at the moment of impact applies to the effect or not; As mentioned above, we can change this via theuseVelocity variable.

We can modify the fundamental part of the effect by changing the landStop field, which controls the position, rotation and scale forces, and how long they stay applied.

The State Data for the player’s current state has a multiplier for this effect.

Last updated

Was this helpful?