Description
The DuckedHeight
property represents the height of the player when they are in a ducked or crouched position. This property is a float
value and is used to adjust the player's collider height when ducking, allowing the player to fit into lower spaces.
Usage
To use the DuckedHeight
property, you can get or set its value to control the height of the player when ducking. This is useful for implementing mechanics where the player needs to crouch to navigate through tight spaces or avoid obstacles.
Example
// Example of setting the DuckedHeight property
PlayerController playerController = new PlayerController();
playerController.DuckedHeight = 0.5f; // Set the ducked height to 0.5 units
// Example of getting the DuckedHeight property
float currentDuckedHeight = playerController.DuckedHeight;
// Use currentDuckedHeight for further logic