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.
Summary
Constructors
- new(material : Enum.Material)
Properties
The mass per unit volume of the part.
The deceleration of the part when rubbing against another part.
The amount of energy retained when colliding with another part.
The importance of the part's Friction property when calculating the friction with the colliding part.
The importance of the part's Elasticity property when calculating the elasticity with the colliding part.
Constructors
Properties
Density
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.01 to 100.0 and values outside this range will be clamped.
Friction
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
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
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
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.