Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a way to extract a part's weight?

I wanted to mess around with the body objects, but its annoying having to edit the force, max force and other things when I don't know what it really does to the brick. Any suggestions or help? I don't know if this fits in the category of scripting but worth a try :l.

1 answer

✓ Accepted answer
mass = part:GetMass()
weight = mass*196.2

To explain further, 196.2 is Roblox's gravity. In physics, the weight of an object is equal to its mass times gravity.

Example: To make a object completely weightless, create a BodyForce inside it like this:

Instance.new("BodyForce",part).force = Vector3.new(0, part:GetMass()*196.2, 0)

In BodyPositions, the MaxForce is the maximum allowed force Roblox is allowed to apply to the object. For example, if you want to move an object somewhere upward with a BodyPosition, the MaxForce on the y axis would need to be greater than the object's weight.

If you've taken physics, you'll also know that Force = Mass * Acceleration. If you want to accelerate an object with a mass of 8 sideways at 2 studs/s^2, you would need to apply a sideways force of 16.

I hope this helped you understand exactly what forces do to parts.

1 comment

0

I never took physics in high school, so all this is new too me but THANK YOU so much.

This discussion is preserved as it was. New answers, comments, and votes are closed.