# BodyAngularVelocity slightly curving balls trajectory near end of travel

I have a ball that needed to be slowed down, so I used BodyAngularVelocity. Without it, the balls path is always just straight unless acted upon by an obstacle. But with the Body, when the ball is nearing a stop, it curves very subtly.

Anyone encounter this before?

Iâ€™ve been keeping up with your posts, and I mightâ€™ve came up with a system that could work for you. Here it is, hope you donâ€™t mind that it isnâ€™t formatted, itâ€™s just super hard to write up code using the 4-space thing, it usually looks terrible every time I try it. This script would assume to be inside your ball object. Two other notes, I didnâ€™t test this, and I didnâ€™t take in account for Y velocity.

``````local slowing_down = false

local delta = .1 --Value/speed for the for loop. Too small of a number may provide you with float inaccuracies.

local function slow_down()
for x = 0,1,delta do
script.Parent.Velocity = Vector3.new(script.Parent.Velocity.X * (1 - x),script.Parent.Velocity.Y,script.Parent.Velocity.Z * (1 - x))
wait()
end
slowing_down = false
end

script.Parent.Changed:Connect(function()
local vel = script.Parent.Velocity
if not slowing_down and (math.abs(vel.X) > 0 or math.abs(vel.Z) > 0) then
slowing_down = true
slow_down()
end
end)
``````
1 Like

Manually changing the velocity and rotvelocity like this hasnâ€™t worked for me, it has had no effect on the ball whatsoever.

Thanks though.

I believe this is related to rotational velocity. When I set the torque in the BodyAngularVelocity to say 100,100,100, it prevents the ball from rotating at all, and this curving doesnâ€™t occur.

Unfortunately for me, I would like the ball to roll.