Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
yurhomi10 192
9 years ago

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

Log in to vote
4
Answered by
2eggnog 981 Moderation Voter
9 years ago
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.

0
I never took physics in high school, so all this is new too me but THANK YOU so much. yurhomi10 192 — 9y
Ad

Answer this question