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 this 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
. You can get or set this property to control whether the character should be able to fall in the current movement mode.
Example
// Example of accessing the AllowFalling property
public class CustomMoveMode : MoveMode
{
public CustomMoveMode()
{
// Enable falling for this custom move mode
AllowFalling = true;
}
public override void OnModeBegin()
{
base.OnModeBegin();
// Additional logic when the mode begins
}
}