void SetSurface( string name )

book_4_sparkGenerated
code_blocksInput

Description

The SetSurface method is used to assign a surface type to all physics bodies within a PhysicsGroup. This can affect how the physics bodies interact with the environment, such as friction and restitution properties.

Usage

To use the SetSurface method, call it on an instance of PhysicsGroup and pass the name of the surface type as a string parameter. Ensure that the surface type name corresponds to a valid surface defined in your physics configuration.

Example

// Example of using SetSurface method
PhysicsGroup physicsGroup = new PhysicsGroup();

// Set the surface type to "Concrete" for all bodies in the group
physicsGroup.SetSurface("Concrete");