What do you want to achieve? Keep it simple and clear!
I have this script that when the vehicle touches a part, I am wanting it to slow down to 0 and stop moving. I don’t want to make it just stop though (I know how to do that I just anchor it), I am wanting it over the speed of 1-2 seconds to slow down and then stop moving.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to use the max speed and go down by 1 every 0.005 seconds, however the vehicle still moved even when the max speed was 0.
local kart = workspace.Karts:FindFirstChild(player.UserId)
local maxSpeed = kart:FindFirstChild("VehicleSeat").MaxSpeed
repeat
print(maxSpeed)
maxSpeed -= 1
kart:FindFirstChild("VehicleSeat").MaxSpeed = maxSpeed
task.wait(0.005)
until maxSpeed == 0
Yes I tried to mess around with BodyVelocity, however I could not figure out how to force the slowing down. I tried setting MaxForce to 0,0,0, P to zero, and Velocity to 0,0,0 but it still had the normal gradual slow down over like 15 seconds.
As I said in my first message, you should apply a force at the opposite direction where the BodyVelocity is working to make the car run, not only turn it to 0, literally the opposite
Weird. BodyVelocity set to 0,0,0 velocity should be an instant stop. (Act as anchored part)
Are you sure you’re not using something else that’s named BodyVelocity?
Oh wait, are you using CFrame.LookVector() for the kart-?
Just realized.
Try disabling the BodyVelocity script when you brake (The one that controls the kart velocity) then lower the speed. (Or set to 0.)
Trial and error ig.