float Friction { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Friction property of the PhysicsShape class represents the friction value of the shape. This value is used to determine 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 a float, so you can assign any valid floating-point number to it.

Example

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

// Example of getting the Friction property
float currentFriction = shape.Friction;
Console.WriteLine($"Current Friction: {currentFriction}");