How do I stop the speed of a vehicle?

Hi, so I am wondering how you can instantly stop the speed of a vehicle without needing its de-acceleration, just instantly stop it so that I can prevent the vehicle from travelling on terrain-types that don’t make sense.

So really, and simply my question is how do I immediately stop a vehicle that is using VehicleSeat- the best I can find is MaxSpeed but that doesn’t make it stop going once it hits a certain velocity! Thank you.

This?

local ResetVelocity = function(Model)
    for Number, Instance2 in pairs(Model:GetDescendants()) do
        if Instance2:IsA("BasePart") then
            Instance2.Velocity = Vector3.new(0, 0, 0)
            Instance2.RotVelocity = Vector3.new(0, 0, 0)
        end
    end
    return
end

That doesn’t seem to work for me, sorry. Thanks though!

Try it now. It should work. Now

Sorry but it still doesn’t work. :confused:

Try BasePart:ApplyImpulse().

Impulse = Change in velocity * mass. You can use BasePart.AssemblyLinearVelocity and BasePart.AssemblyMass to get the values needed.

The equation should look something like this:

local basePart --A BasePart of the car/assembly

--Stops the car/assembly:
basePart:ApplyImpulse(-1*BasePart.AssemblyLinearVelocity*BasePart.AssemblyMass)
1 Like

Did you call the function and put your vehicle in the parenthesis like this?

local ResetVelocity = function(Model)
		for Number, Instance2 in pairs(Model:GetDescendants()) do
			if Instance2:IsA("BasePart") then
				Instance2.Velocity = Vector3.new(0, 0, 0)
				Instance2.RotVelocity = Vector3.new(0, 0, 0)
			end
		end
		return
	end

    ResetVelocity(Put Your Vehicle Here)

(I think the velocity property is read only so it can’t be changed.)

Yeah, I did. It resets the max velocity but not the current velocity if i’m not mistakened. BY THE WAY, MY VEHICLE IS A BOAT- NOT A CAR!

1 Like

Sorry Pseudo but I just tried the script and it didn’t work. I will just use my way I guess even if it’s not the most efficient.

I guess you could try anchoring it?

Personally, applying a force opposite of the current force should set the velocity to zero, ofc that’s according to Newton’s laws.

Setting the velocity to zero would not work due to motion already occurring, it’s like trying to stop a car going 50mph, you can unless you have a reaction with the same amount of force to equal zero.

Car.Velocity = -Car.Velocity

Now if you didn’t want to do this, anchoring the part prevents any movement whatsoever; this would work yes, however, you would need to unanchor it later to apply any valid movement/physics to the object.

1 Like

Thanks guys for all the help but I solved it through anchoring.