bool AllowGrounding { get; set; }

robot_2Generated
code_blocksInput

Description

The AllowGrounding property is a boolean flag within the MoveMode class, which determines whether the character is allowed to be grounded. This property is virtual, allowing derived classes to override its behavior if necessary.

Usage

Use the AllowGrounding property to control whether the character can be grounded during movement. This can be useful in scenarios where you want to enable or disable grounding based on specific conditions or game mechanics.

Example

// Example of using the AllowGrounding property
public class CustomMoveMode : MoveMode
{
    public override bool AllowGrounding
    {
        get
        {
            // Custom logic to determine if grounding is allowed
            return base.AllowGrounding && SomeCustomCondition();
        }
    }

    private bool SomeCustomCondition()
    {
        // Implement your custom condition logic here
        return true; // Example condition
    }
}