Hand-written by Joseph San Nicolas, Roblox Developer
PhysicalProperties
Constructors
| Name | Description |
| new(material: Enum.Material) | Returns a PhysicalProperties container with the default density, friction, and elasticity for the given material. |
| new(density: number, friction: number, elasticity: number) | Returns a PhysicalProperties container with the given density (clamped to [0.0001, 100]), friction (clamped to [0, 2]), and elasticity (clamped to [0, 1]). |
| new(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number) | Returns a PhysicalProperties container with the given density, friction, and elasticity, plus frictionWeight and elasticityWeight (each clamped to [0, 100]), which control how much this part's friction and elasticity count toward the pairwise average used during collisions. |
| new(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number, acousticAbsorption: number) | Returns a PhysicalProperties container with all of the above plus acousticAbsorption (clamped to [0, 1]), which controls how much sound energy the surface absorbs during acoustic simulation. |
Code Snippet
local part = workspace.Part
-- Use the default physical properties for a material
part.CustomPhysicalProperties = PhysicalProperties.new(Enum.Material.Ice)
-- Or specify exact values: density, friction, elasticity, frictionWeight, elasticityWeight
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0.3, 0.5, 1, 1)
Properties
| Name | Type | Description |
| Density | number | The mass per unit volume of the part, clamped to the range [0.0001, 100]. |
| Friction | number | The coefficient of friction opposing sliding motion between two surfaces in contact, clamped to [0, 2]. |
| Elasticity | number | A part's tendency to retain energy when colliding with another part (bounciness), clamped to [0, 1]. |
| FrictionWeight | number | The weight of this part's friction in the pairwise weighted average used during collisions, clamped to [0, 100]. |
| ElasticityWeight | number | The weight of this part's elasticity in the pairwise weighted average used during collisions, clamped to [0, 100]. |
| AcousticAbsorption | number | How much sound energy the surface absorbs during acoustic simulation, clamped to [0, 1]. |