Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsShape.SurfaceMaterial

Defines the dynamics of a surface on a shape.
Read time 2 minutesLast updated 12 days ago

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsShape.SurfaceMaterial

Constructors

Constructor

Description

SurfaceMaterial()Create a default surface material.
SurfaceMaterial(System.Boolean)Create a default surface material.

Properties

Property

Description

bouncinessThe bounciness (coefficient of restitution) usually in the range [0, 1].
bouncinessMixingDefines the method used when mixing the bounciness values of two shapes to form a contact.
bouncinessPriorityThe priority for mixing the _bounciness properties when two shapes come into contact. If the priority of one shape is higher than the other shape then the higher priority _bouncinessMixing will be used. If the priority of both shapes are the same then simply the higher enumeration value of PhysicsShape.SurfaceMaterial.MixingMode from both shapes will be used.
customColorCustom debug draw color. Any color value other than (0,0,0,0) will be used to render the shape. This value is passed back when using the PhysicsWorld drawing. The alpha value here is always ignored.
frictionThe Coulomb (dry) friction coefficient, usually in the range [0, 1].
frictionMixingDefines the method used when mixing the friction values of two shapes to form a contact.
frictionPriorityThe priority for mixing the _friction properties when two shapes come into contact. If the priority of one shape is higher than the other shape then the higher priority _frictionMixing will be used. If the priority of both shapes are the same then simply the higher enumeration value of PhysicsShape.SurfaceMaterial.MixingMode from both shapes will be used.
rollingResistanceThe rolling resistance usually in the range [0, 1].
tangentSpeedThe tangent (surface) speed.

Static Properties

Property

Description

defaultMaterialGet the default surface material.

Enums

Enum

Description

PhysicsShape.SurfaceMaterial.MixingModeThe method used to mix friction or bounciness values.