Stopping a part with bodymover

After reading this post: BodyVelocity Stopping - #32 by lynnlo, I had realized my model wasn’t stopping due to the presence of another body velocity. However, this other body velocity is to keep the model from falling due to gravity, and by setting the max force of that body velocity to 0, the model would fall to the ground.
I had toyed with the idea of anchoring the model, however I don’t want the model to stop instantly.

server script

local RepStorarge = game:GetService("ReplicatedStorage")

RepStorarge.Movement.Speed.OnServerEvent:Connect(function(player, isGoingForward, speed, SubRootPart)
	if isGoingForward then
		SubRootPart.Anchored = false
		SubRootPart.BodyVelocity.MaxForce = Vector3.new(10*speed, 0, 10*speed)
		SubRootPart.BodyVelocity.P = math.huge
		SubRootPart.BodyVelocity.Velocity = SubRootPart.CFrame.LookVector * 100	
	else	-- Stop model
		SubRootPart.BodyVelocity.MaxForce = Vector3.new(0, 0, 0)
		SubRootPart.BodyVelocity.P = 0
		SubRootPart.BodyVelocity.Velocity = SubRootPart.CFrame.LookVector * 0
		
		SubRootPart.YAxis.MaxForce = Vector3.new(0, 0, 0)
	end	
end)
2 Likes

If I understand you right, you’ve got 1 BodyVelocity for “anti gravity” with MaxForce 0 and X and Z and some large number on Y?

And another with some MaxForce on X and Z and none on Y?

If so, the two BodyVelocities shouldn’t affect each other at all.

Can you explain what you mean by

Do you want to stop the horizontal or vertical movement?

1 Like

You’re assumption is correct, this is the bodymover which moves the model when the number 2 key is pressed, thus moving the model. https://gyazo.com/8ecdb9a144066649d99cc04b648b41ba

And by “my model wasn’t stopping”: https://gyazo.com/b021310e6ed9c0eecc16f73bb62e1c45
(see output window)

2 Likes

Can’t stop it without applying force. So try it without setting the MaxForce and P to 0. Just leave them at 10*speed and math.huge.

1 Like