How to slow down car that uses body force

Hi,
Okay i have a car that uses body force to move, but i got a few issues:

  1. Im not good at math, how to make a static car speed? Currently i use this to make speed for car, but its make my car extremely fast.

bodyForce.Force = humanoidRootPart.CFrame.lookVector * movement.Y * (mass + stats.Speed.Value)

stats.Speed.Value is 60
movement.Y is basically where car moves (forward or backward)
mass is mass of all car parts * gravity multiplier

  1. I don’t know how to stop my car. When i no longer press W to drive it still moves…

To slow down car i do bodyForce.Force = Vector3.new(0,0,0)

I just recently started using Body Movers so idk how they work i use the info provided in DevHub but still understand a little.

For a crude fix I suggest just making the same thing as speeding up but reversing the direction. To reverse direction simply multiply by negative one

2 Likes

I agree with @SuperZebe1. You could do that but you might have to do that in a for loop so it’s not harsh.

1 Like

I did and it work i guess!

But… Here is how fast my car with 1 stats.Speed.Value. I would like to make something better, but im not good at it. Do you have any ideas how to make better Force calculating thingy?

https://gyazo.com/c399927310b70ef08e2fecfa19505d63

Try changing the math where you calculate the body velocity, tweek it until you feel like it’s the right speed.
Edit i don’t have a computer at the ready but try something like HumanoidRootPart.CFrame.lookVector * speed
If the speed changes depending on where you look then try adding .Unit after HumanoidRootPart.CFrame.lookVector

Does your car use wheels with hinges to roll? You could try setting a torque force on that to brake when you release W.

It don’t work, probably because BodyForce’s Force property should be bigger than mass of car to be able to push it? I tried and if i don’t multiply lookvector by mass of car it won’t move

No, my car is just a model with VehicleSit, but VehicleSit don’t actually do anything except make player sit in car and i check through VehicleSit property Throttle if player is driving and if so where (forward or backward). The car movement i do in script

Make a part in the center of the car and make it the primary part
Make sure the front surface is facing the same as the front of the car.

bodyForce.Force = carPrimary.CFrame.lookVector*((movement.Y * (mass + stats.Speed.Value))/5)

not sure if this would work

Also try to reduce movement Y. that may be the problem