System.Nullable<float> Friction { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Friction property of the Collider class allows you to override the default friction value for a specific collider. This property is useful for customizing how surfaces interact with each other in terms of sliding resistance. The friction value is typically between 0 and 1, where 0 represents no friction (completely slippery) and 1 represents maximum friction (very grippy). However, you can set this value to exceed 1 if you desire an exceptionally high friction effect.

Usage

To use the Friction property, simply set it to a float value within the desired range. If you do not set this property, the collider will use the default friction value defined by the physics material or engine settings.

Example usage:

Collider myCollider = new Collider();
myCollider.Friction = 0.5f; // Sets the friction to a moderate level

Example

Collider myCollider = new Collider();
myCollider.Friction = 0.5f; // Sets the friction to a moderate level