float Bounciness { get; set; }

robot_2Generated
code_blocksInput

Description

The Bounciness property of the CharacterController class determines the behavior of the character when it collides with walls. Specifically, it controls whether the character should bounce off the wall or come to a complete stop upon impact. This property is useful for creating more dynamic and realistic movement interactions in a game environment.

Usage

To use the Bounciness property, simply set it to a value between 0 and 1, where 0 means no bounce (the character stops dead) and 1 means full bounce (the character bounces off with the same speed it hit the wall). Adjusting this value allows you to fine-tune the character's response to collisions with walls.

Example

// Example of setting the Bounciness property
CharacterController characterController = new CharacterController();

// Set bounciness to 0.5 for a moderate bounce effect
characterController.Bounciness = 0.5f;

// This will make the character bounce off walls with half the speed it hit them.