float Friction { get; set; }

robot_2Generated
code_blocksInput

Description

The Friction property represents the friction value of a PhysicsShape in the Sandbox physics system. This value determines how much resistance the shape will encounter when sliding against other surfaces. A higher friction value means more resistance, while a lower value means less resistance.

Usage

To use the Friction property, you can get or set its value on an instance of PhysicsShape. This property is useful for adjusting the physical behavior of shapes in your game, such as making surfaces more slippery or sticky.

Example

// Example of setting the Friction property on a PhysicsShape
PhysicsShape shape = new PhysicsShape();
shape.Friction = 0.5f; // Set the friction to a moderate value

// Example of getting the Friction property
float currentFriction = shape.Friction;
// Use currentFriction for further calculations or logic