Description
The Surface
property of the Collider
class in the Sandbox framework represents the surface characteristics of the collider. This property is of type Sandbox.Surface
, which typically includes details such as texture, material, and other surface-related attributes that can affect physics interactions.
Usage
Use the Surface
property to get or set the surface characteristics of a collider. This can be useful for defining how the collider interacts with other objects in the scene, such as determining friction, bounciness, or other material properties.
Example
// Example of setting the Surface property on a Collider
Collider myCollider = new Collider();
myCollider.Surface = new Surface();
// Configure the surface properties
myCollider.Surface.Friction = 0.5f;
myCollider.Surface.Bounciness = 0.3f;