Description
The AllowFalling
property is a boolean flag within the MoveMode
class, which is part of the Sandbox.Movement
namespace. This property determines whether the character is allowed to fall when in the current movement mode. It is a virtual property, allowing derived classes to override its behavior if necessary.
Usage
To use the AllowFalling
property, you can access it directly from an instance of a class that derives from MoveMode
. This property can be set to true
or false
depending on whether you want the character to be able to fall in the current movement mode.
Example
// Example of using the AllowFalling property
public class CustomMoveMode : MoveMode
{
public CustomMoveMode()
{
// Allow the character to fall in this custom move mode
AllowFalling = true;
}
public override void OnModeBegin()
{
base.OnModeBegin();
// Additional logic when the mode begins
}
public override void OnModeEnd(MoveMode next)
{
base.OnModeEnd(next);
// Additional logic when the mode ends
}
}