Description
The SurfaceMaterial
property of the PhysicsBody
class is used to set the surface material for all child PhysicsShape
objects associated with this PhysicsBody
. This property helps in determining the most commonly occurring surface name among all the PhysicsShape
objects of the PhysicsBody
.
Usage
To use the SurfaceMaterial
property, simply assign a string value representing the desired surface material. This will propagate the material setting to all child PhysicsShape
objects.
Example
// Example of setting the SurfaceMaterial property
PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.SurfaceMaterial = "Concrete";
// This sets the surface material of all child PhysicsShapes to "Concrete".