Data type
PhysicalProperties
Describes properties that affect the physical behavior of a BasePart.
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)
endAlthough 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#
| new | Returns a PhysicalProperties with the default properties for
the given material. |
| new | Returns a PhysicalProperties with the specified density,
friction, and elasticity. |
| new | Creates a PhysicalProperties container with the specified
density, friction, elasticity, weight of friction, and weight of
elasticity. |
| new | Creates a PhysicalProperties container with the specified
density, friction, elasticity, weight of friction, weight of elasticity,
and acoustic absorption. |
new(material: Material)#
Returns a PhysicalProperties container, with the density,
friction, and elasticity specified for this material.
new(density: number, friction: number, elasticity: number)#
Returns a PhysicalProperties container, with the specified
density, friction, and elasticity.
| Name | Type | Default | 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, clamped to [0, 2]. | |
elasticity | number | The coefficient of restitution (bounciness) applied on collision, clamped to [0, 1]. |
new(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number)#
Creates a PhysicalProperties container with the specified
density, friction, elasticity, weight of friction, and weight of
elasticity.
| Name | Type | Default | 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, clamped to [0, 2]. | |
elasticity | number | The coefficient of restitution (bounciness) applied on collision, clamped to [0, 1]. | |
frictionWeight | number | The weight of this part's friction in the pairwise weighted average, clamped to [0, 100]. | |
elasticityWeight | number | The weight of this part's elasticity in the pairwise weighted average, clamped to [0, 100]. |
new(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number, acousticAbsorption: number)#
Creates a PhysicalProperties container with the specified
density, friction, elasticity, weight of friction, weight of elasticity,
and acoustic absorption.
| Name | Type | Default | 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, clamped to [0, 2]. | |
elasticity | number | The coefficient of restitution (bounciness) applied on collision, clamped to [0, 1]. | |
frictionWeight | number | The weight of this part's friction in the pairwise weighted average, clamped to [0, 100]. | |
elasticityWeight | number | The weight of this part's elasticity in the pairwise weighted average, clamped to [0, 100]. | |
acousticAbsorption | number | How much sound energy the surface absorbs during acoustic simulation, clamped to [0, 1]. |
Properties 6#
AcousticAbsorptionnumber | A value between 0 and 1 denoting how absorbent the material is to
AudioEmitters. |
Densitynumber | The mass per unit volume of the part. |
Frictionnumber | The deceleration of the part when rubbing against another part. |
Elasticitynumber | The amount of energy retained when colliding with another part. |
FrictionWeightnumber | The importance of the part's
Friction property when calculating
the friction with the colliding part. |
ElasticityWeightnumber | The importance of the part's
Elasticity property when
calculating the elasticity with the colliding part. |
AcousticAbsorption: number#
A value between 0 and 1 denoting how absorbent the material is to
AudioEmitters. 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: number#
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.0001 to 100.0 and values outside this range will be clamped.
When using acoustic simulation, parts with higher density will muffle
occluded AudioEmitters more.
Friction: number#
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.0 to 2.0 and values outside this range
will be clamped.
Elasticity: number#
Elasticity refers to a part's tendency to retain energy when colliding
with another part. An Elasticity
of 1 indicates that the part bounces with the same energy it had before a
collision. Acceptable range is 0.0 to 1.0 and values outside this
range will be clamped.
FrictionWeight: number#
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 its
Friction is used. Acceptable range
is 0.0 to 100.0 and values outside this range will be clamped.
ElasticityWeight: number#
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
its Elasticity is used.
Acceptable range is 0.0 to 100.0 and values outside this range will be
clamped.