Created
November 19, 2025 17:03
-
-
Save gaymeowing/f91b37baea86a1adb5f1383d49103827 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ | |
| set mass | |
| sets a parts mass to the given new_mass using PhysicalProperties | |
| ]] | |
| local function set_mass(part: BasePart, new_mass: number) | |
| local current_physical_properties = part.CurrentPhysicalProperties | |
| local extents_size = part.ExtentsSize | |
| part.CustomPhysicalProperties = PhysicalProperties.new( | |
| new_mass / (extents_size.X * extents_size.Y * extents_size.Z), | |
| current_physical_properties.Friction, | |
| current_physical_properties.Elasticity, | |
| current_physical_properties.FrictionWeight, | |
| current_physical_properties.ElasticityWeight | |
| ) | |
| end | |
| return set_mass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment