float GroundFriction { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The GroundFriction property represents the friction coefficient of the ground that the player is currently standing on. This value is used to determine how much the player will slow down when moving across the ground. A higher friction value means the player will decelerate more quickly when not actively moving.

Usage

Use the GroundFriction property to adjust the player's interaction with the ground surface. This can be useful for simulating different types of terrain, such as ice or mud, by setting the friction to a lower or higher value respectively.

Example

// Example of setting the ground friction for a player controller
PlayerController playerController = new PlayerController();
playerController.GroundFriction = 0.8f; // Set a higher friction for rough terrain