VectorForce problem

I’m trying to create a part that moves up constantly and slowly, but the problem is that the VectorForce does nothing when you set the Force to a low Y-Value, it only works when you set it a high Y-Value but then it is really fast and not slow anymore. I already tried to change Friction value of the part to 0.01 and make the part massless but it still didn’t help.

2 Likes

Thing is, any time there’s a force being applied it will cause an acceleration, or change in velocity. That means you can’t have a constant force. The force should be high when the body is far from moving at the right velocity, and low when it’s close to the right velocity.

The easiest way to get what you want is probably to not control the force directly, but instead control the velocity which is what you really care about. You can do that with a BodyVelocity: BodyVelocity | Roblox Creator Documentation

1 Like

but bodyVelocity is legacy and it was encouraged that you use the new constraints (e.g. vectorForce)

1 Like

Yep, but Roblox hasn’t done a great job of making sure the new Constraint types actually cover all the use cases that are possible with the old BodyMovers, so in some cases it’s necessary to use the “legacy” things.

AFAIK the closest you can get with the Constraints is AlignPosition by setting MaxVelocity and MaxForce. Or you can use a VectorForce + a PD controller script. I made a tutorial on P control (half of a PD controller) a while back, if you want to go that route.

I’d still go with BodyVelocity, it’s just a lot simpler and it’s not like it’ll be deprecated/removed from Roblox.

1 Like

Actually, I just tried something out and by doing VectorForce.Force = Part:GetMass() * workspace.Gravity + 150 it actually doesn’t go as fast anymore, but I still got one problem: the parts gets faster and faster and doesn’t stay constant for some reason even though I don’t change the velocity

Do you mean the force? You can’t not change the velocity with a VectorForce. As long as there’s a net force on a body, it’s going to accelerate. I.e. change velocity/speed. You can’t get it to not go faster and faster over time with a constant force.

im using bodyVelocity now, even though it is legacy it is way easier to use than this.

3 Likes