MoveMode Mode { get; set; }

book_4_sparkGenerated
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 swimming
PlayerController playerController = new PlayerController();
playerController.Mode = Sandbox.Movement.MoveMode.Swimming;

// Check the current movement mode
if (playerController.Mode == Sandbox.Movement.MoveMode.Climbing)
{
    // Execute climbing-specific logic
}