bool AllowGrounding { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The AllowGrounding property of the MoveModeWalk class determines whether the character is allowed to be grounded while in the walking mode. This property is a boolean value and can be overridden in derived classes.

Usage

Use the AllowGrounding property to control whether the character should be able to maintain contact with the ground while walking. This can be useful for implementing features such as walking on uneven terrain or handling transitions between different movement states.

Example

// Example of using the AllowGrounding property

public class CustomWalkMode : MoveModeWalk
{
    public CustomWalkMode()
    {
        // Disable grounding for this custom walk mode
        AllowGrounding = false;
    }

    public override void PrePhysicsStep()
    {
        // Custom logic before physics step
        base.PrePhysicsStep();
    }
}