Data type
PhysicalProperties
Describes properties that affect the physical behavior of a BasePart.
About PhysicalProperties
The PhysicalProperties data type describes several physical
properties of a BasePart:
Density,
Elasticity, and
Friction. It is used in the
similarly-named BasePart.CustomPhysicalProperties property.
Weighting Behavior
PhysicalProperties also provides weightings properties,
ElasticityWeight and
FrictionWeight. When two parts
interact, the friction and elasticity between them are determined in the same
way by the following pairwise weighted average function:
local function getActualFriction(partA, partB)
return (partA.Friction * partA.FrictionWeight + partB.Friction * partB.FrictionWeight) / (partA.FrictionWeight + partB.FrictionWeight)
end
Although the formula above refers to the
Friction and
FrictionWeight of two parts,
A and B, the formula is used in the same manner when determining
Elasticity. Generally, when the
weight of A is much greater than that of B, the actual value will be
closer to A. If the weights are similar, the actual value will be close to
the midpoint between their individual values.
Constructors 4
PhysicalProperties.new
(material: Material)Returns aPhysicalPropertieswith the default properties for the given material.PhysicalProperties.new
(density: number, friction: number, elasticity: number)Returns aPhysicalPropertieswith the specified density, friction, and elasticity.PhysicalProperties.new
(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number)Creates aPhysicalPropertiescontainer with the specified density, friction, elasticity, weight of friction, and weight of elasticity.PhysicalProperties.new
(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number, acousticAbsorption: number)Creates aPhysicalPropertiescontainer with the specified density, friction, elasticity, weight of friction, weight of elasticity, and acoustic absorption.
Properties 6
AcousticAbsorption
: numberA value between0and1denoting how absorbent the material is toAudioEmitters.A value between
0and1denoting how absorbent the material is toAudioEmitters. When using acoustic simulation, surfaces with higher absorption will result in less reverb than surfaces with lower absorption.Note that this does not affect the degree to which audio transmits through surfaces; for that, see
Density.Density
: numberThe mass per unit volume of the part.Density is defined as the amount of mass per unit volume. The more dense a part is, the more force it takes to accelerate it. Acceptable range is
0.0001to100.0and values outside this range will be clamped.When using acoustic simulation, parts with higher density will muffle occluded
AudioEmittersmore.Friction
: numberThe deceleration of the part when rubbing against another part.Friction is defined as the force that opposes the relative lateral motion of two solid surfaces in contact. The greater the friction on a part, the quicker it will decelerate when it rubs against another part with friction. Acceptable range is
0.0to2.0and values outside this range will be clamped.Elasticity
: numberThe amount of energy retained when colliding with another part.Elasticity refers to a part's tendency to retain energy when colliding with another part. An
Elasticityof 1 indicates that the part bounces with the same energy it had before a collision. Acceptable range is0.0to1.0and values outside this range will be clamped.FrictionWeight
: numberThe importance of the part'sFrictionproperty when calculating the friction with the colliding part.The friction weight of two parts rubbing together creates a ratio used to calculate the actual friction between the two parts. The higher a part's
FrictionWeight, the more itsFrictionis used. Acceptable range is0.0to100.0and values outside this range will be clamped.ElasticityWeight
: numberThe importance of the part'sElasticityproperty when calculating the elasticity with the colliding part.The elasticity weight of two parts colliding creates a ratio used to calculate the actual elasticity between the two parts. The higher a part's
ElasticityWeight, the more itsElasticityis used. Acceptable range is0.0to100.0and values outside this range will be clamped.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.