Description
The IsOnGround
property of the CharacterController
class indicates whether the character is currently in contact with the ground. This property is useful for determining if the character can perform actions that require ground contact, such as jumping.
Usage
Use the IsOnGround
property to check if the character is on the ground before executing actions that require ground contact. This property is synchronized across the network, ensuring consistent behavior in multiplayer environments.
Example
// Example of using IsOnGround property
CharacterController characterController = new CharacterController();
// Check if the character is on the ground
if (characterController.IsOnGround)
{
// Perform actions that require the character to be on the ground
// For example, allow the character to jump
characterController.Jump();
}