Roblox UtilitiesDevlHub Roblox Documentation

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:

Luau
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#

newReturns a PhysicalProperties with the default properties for the given material.
newReturns a PhysicalProperties with the specified density, friction, and elasticity.
newCreates a PhysicalProperties container with the specified density, friction, elasticity, weight of friction, and weight of elasticity.
newCreates 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.

NameTypeDefaultDescription
materialMaterialThe Material for which to retrieve default physical properties.

new(density: number, friction: number, elasticity: number)#

Returns a PhysicalProperties container, with the specified density, friction, and elasticity.

NameTypeDefaultDescription
densitynumberThe mass per unit volume of the part, clamped to the range [0.0001, 100].
frictionnumberThe coefficient of friction opposing sliding motion, clamped to [0, 2].
elasticitynumberThe 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.

NameTypeDefaultDescription
densitynumberThe mass per unit volume of the part, clamped to the range [0.0001, 100].
frictionnumberThe coefficient of friction opposing sliding motion, clamped to [0, 2].
elasticitynumberThe coefficient of restitution (bounciness) applied on collision, clamped to [0, 1].
frictionWeightnumberThe weight of this part's friction in the pairwise weighted average, clamped to [0, 100].
elasticityWeightnumberThe 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.

NameTypeDefaultDescription
densitynumberThe mass per unit volume of the part, clamped to the range [0.0001, 100].
frictionnumberThe coefficient of friction opposing sliding motion, clamped to [0, 2].
elasticitynumberThe coefficient of restitution (bounciness) applied on collision, clamped to [0, 1].
frictionWeightnumberThe weight of this part's friction in the pairwise weighted average, clamped to [0, 100].
elasticityWeightnumberThe weight of this part's elasticity in the pairwise weighted average, clamped to [0, 100].
acousticAbsorptionnumberHow much sound energy the surface absorbs during acoustic simulation, clamped to [0, 1].

Properties 6#

AcousticAbsorptionnumberA value between 0 and 1 denoting how absorbent the material is to AudioEmitters.
DensitynumberThe mass per unit volume of the part.
FrictionnumberThe deceleration of the part when rubbing against another part.
ElasticitynumberThe amount of energy retained when colliding with another part.
FrictionWeightnumberThe importance of the part's Friction property when calculating the friction with the colliding part.
ElasticityWeightnumberThe 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.