Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there anyway to stop the ball from doing this?

Asked by
roquick 41
6 years ago

Hi, I have a ball that moves with velocity. However, once the ball has stopped moving, you can still see the ball spin around like crazy even though its not moving anymore

Is there anyway to stop the ball from spinning once its finished moving? I tried setting rotvelocity to vector3.new(0,0,0) but it still spins

is this a Roblox glitch? is there anyway to stop it?

1 answer

Log in to vote
1
Answered by 6 years ago

You can insert a BodyAngularVelocity when you want the ball to stop spinning.

local ball = game.Workspace.Ball
...
-- The ball has now stopped rolling, but is still spinning
local angularVelocity = Instance.new("BodyAngularVelocity", ball)
local maxTorque = 1000 -- How much torque used to stop the ball from spinning
local duration = 3 -- How long the "anti-spin" force is applied
angularVelocity.AngularVelocity = Vector3.new(0, 0, 0)
angularVelocity.MaxTorque = Vector3.new(maxTorque, maxTorque, maxTorque)
wait(duration)
angularVelocity:Destroy()
-- Hopefully the ball has stopped spinning
0
thank you roquick 41 — 6y
Ad

Answer this question