PhysicalProperties

Overview

PhysicalProperties is a configuration object for defining how a BasePart reacts physically. It includes physical elements such as density, elasticity, and friction, which can be applied to individual parts through the CustomPhysicalProperties property.

Additionally, each physical property comes with a weight concept. When two parts contact each other, friction and elasticity are calculated by combining each part's values and weights, with the side having greater weight having more influence on the result. When weights are similar, a value that balances the characteristics of both parts is applied.

Constructors

new

Creates and returns a PhysicalProperties object with default physical settings defined for a specific material. The returned object has pre-applied values related to the material's density, friction, and elasticity.

Parameters

Material InMaterial

Specifies the material that will form the basis of the PhysicalProperties, and the object is created based on the density, friction, and elasticity values defined for that material.

Return

PhysicalProperties

The created PhysicalProperties.

Code Samples

local CustomProperties = PhysicalProperties.new(Enum.Material.Wood)

new

Creates and returns a PhysicalProperties object based on the specified density, friction, and elasticity values. This allows detailed configuration of a part's physical characteristics.

Parameters

number InDensity

Specifies the material's density. Higher values increase the part's mass and require more force to accelerate.

number InFriction

Specifies the material's friction. Affects sliding when in contact with other parts.

number InElasticity

Specifies the material's elasticity. Affects the degree of rebound during collisions.

number InFrictionWeight

Specifies the weight used in friction calculations. Determines the influence ratio of the friction value when interacting with other parts.

number InElasticityWeight

Specifies the weight used in elasticity calculations. Determines how much the elasticity value is reflected in the result during collisions.

Return

PhysicalProperties

The created PhysicalProperties.

Code Samples

Properties

Density

number

Specifies the material's density. Higher values increase the part's mass and require more force to accelerate.

Configurable values are limited to 0 to 1000, and values exceeding the range are automatically corrected by the system.

Code Samples

Friction

number

Specifies the material's friction. Affects sliding when in contact with other parts.

Configurable values are limited to 0 to 2, and values exceeding the range are automatically corrected by the system.

Code Samples

Elasticity

number

Specifies the material's elasticity. Affects the degree of rebound during collisions.

Configurable values are limited to 0 to 1, and values exceeding the range are automatically corrected by the system.

Code Samples

FrictionWeight

number

Specifies the weight used in friction calculations. Determines the influence ratio of the friction value when interacting with other parts.

When two parts contact, the final friction value is calculated based on each weight, with higher values meaning that part's friction characteristics have greater influence.

Code Samples

ElasticityWeight

number

Specifies the weight used in elasticity calculations. Determines how much the elasticity value is reflected in the result during collisions.

The final elasticity value is calculated based on the weights of both parts, with higher values meaning that part's rebound characteristics are applied more strongly.

Code Samples

Methods

Last updated