MoveMode Mode { get; set; }

robot_2Generated
code_blocksInput

Description

The Mode property of the PlayerController class represents the current movement mode of the player. It is of type Sandbox.Movement.MoveMode, which defines various movement states such as walking, running, swimming, or climbing.

Usage

Use the Mode property to get or set the player's current movement mode. This can be useful for determining how the player should interact with the environment or for applying specific movement logic based on the current mode.

Example

// Example of setting the player's movement mode to climbing
PlayerController playerController = new PlayerController();
playerController.Mode = Sandbox.Movement.MoveMode.Climbing;

// Check the current movement mode
if (playerController.Mode == Sandbox.Movement.MoveMode.Swimming)
{
    // Apply swimming logic
}