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.
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.
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 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 }