Description
The Height
property of the CharacterController
class represents the height of the character in the game world. This property is used to define the vertical size of the character's collision capsule, which affects how the character interacts with the environment, such as fitting through spaces and colliding with objects.
Usage
To set the height of a character, assign a float
value to the Height
property. The value must be within the range specified by the RangeAttribute
, which is from 0 to 200. The property is not static, so it must be accessed through an instance of the CharacterController
class.
Example
// Example of setting the height of a character
CharacterController characterController = new CharacterController();
characterController.Height = 180.0f; // Set the character's height to 180 units