BodyVelocity acceleration?

What kind of maths do I need to do so a BodyVelocity velocity doesn’t immediately snap to the supplied Vector3, but instead speeds up to it?

Assuming that there is no friction involved:

NeededForce = BodyMass * WantedAcceleration

For example, this simple script would create a part floating in the air as the acceleration caused by the bodyforce counteracts the acceleration caused by the gravity.

local p = Instance.new("Part")
local bf = Instance.new("BodyForce")

bf.Force = p:GetMass() * Vector3.new(0,workspace.Gravity,0)
bf.Parent = p
p.Parent = workspace 

Same for BodyVelocity? I’m not able to try it yet

The lower the P, the lower the extra thrust applied when the target isn’t reached yet. Messing around with this should make it accelerate slow but certain.

Acceleration is always proportional to the force applied to the object regardless of the type of bodymover being used.

It doesn’t work how I want it to, setting the P lower just makes it slower…

Is PGS enabled in your game? According to the wiki, the “P” property in BodyVelocity is ignored when you have PGS enabled.

You really shouldn’t worry about the Forces when working with BodyVelocities. Internally, it handles most of that for you: a BodyVelocity with a Velocity vector of 0,0,0 and a sufficiently high MaxForce causes any unanchored part to float. You don’t have to calculate the force to oppose gravity yourself.

If you want to make it appear to accelerate while using a BodyVelocity, I would recommend using something like TweenService to tween the Velocity value. Also, make sure to set the MaxForce to a very large vector.

1 Like

Ah thanks! I was not looking for making something hover, but instead appear like it’s accelerating. I will try using TweenService :grin: