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

How do I make something float with BodyVelocity?

Asked by 10 years ago

I am working on a new game that I need a script to make it so any part with any material can float, and I need a way to change the velocity via a script. The material is different each time, meaning the gravity will be different each time.

1 answer

Log in to vote
2
Answered by
nate890 495 Moderation Voter
10 years ago

You need to get the mass of the object using the GetMass method and then multiply the mass by gravity, which is 196.2 on Roblox. Also note that you should use BodyForce and not BodyVelocity for this.

Part.BodyForce.force = Vector3.new(0, Part:GetMass() * 196.2, 0)
0
Uh... how do you get 196.2? FromLegoUniverse 264 — 10y
0
Check out this wiki page on gravity: http://wiki.roblox.com/index.php?title=Gravity nate890 495 — 10y
0
Ok, thanks. FromLegoUniverse 264 — 10y
Ad

Answer this question