Ball Doesn't Stop Rolling

  1. What do you want to achieve? Keep it simple and clear!
    I’m working on a soccer game. I want to fix the default physics
  2. What is the issue? Include screenshots / videos if possible!
    As a test I made a sphere part and set the collision to true and anchored to false. If I push the ball with my body, the ball never stops moving. (If I make a shot ability, and then destroy the object I use to propel the ball it will probably keep on moving by this logic.)
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Searching around the internet and playing around with part settings.

You can set to true CustomPhysicalProperties and then adjust elasticy and friction until you like the result

1 Like

ok ty ima try it rn ill let you know and mark as solution if it works

1 Like

ive played around, and no matter what i change the ball doesnt decelerate, even with max friction, pushing it slightly makes it go slow but it continues rolling till it falls off the map

1 Like

hmmm, thats odd, maybe you could adjust density too, or change the gravity of the workspace, anyways, i’ll replicate your problem to see what are the best properties to change, also, could you give me the propiertes of your ball? to make it accurate

1 Like

ive changed them several times and this is their current state
image
image

You’ll probably want to modify this with client-side physics, but here’s a simple server-side example:

local ball = script.Parent
local alignOrientation = Instance.new('AlignOrientation',ball)
local attachment = Instance.new('Attachment',ball)
local notDestroyed = true

alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
alignOrientation.MaxTorque = 100
alignOrientation.Responsiveness = 5
alignOrientation.Attachment0 = attachment

while notDestroyed do
	alignOrientation.CFrame = ball.CFrame
	task.wait(.1)
end

local destroying
destroying = ball.Destroying:Connect(function()
	destroying:Disconnect()
	ball,alignOrientation,attachment,notDestroyed,destroying = nil
end)

The idea is basically to constantly set the orientation back to what it previously was. You may want to adjust some values to make it feel right.

2 Likes

ok tysm unless @welota gives an easier solution ill use this tmrw im going to bed soon tho so probably not adding today

So i might have a solution, if you use a while true do in a script, and then write AssemblyLinearVelocity *= .9

while task.wait(1) do
   ball.AssemblyLinearVelocity *= .9
end

also, if you want the ball to slowdown faster, you can multiplie the velocity by a smaller number

Edit: this is the physical properties i used (if you need then)
image

2 Likes

ok ty ig theres no actual way to do this without scripts both of yall answers worth as solutions but ig ill mark yours cuz its simpler thanks fate tho

1 Like

doing more tests, i saw that the ball actually needs time to work ig

i recorded this video, so the ball actually stops, but it took some time, i thinks because of using command line instead of a script

https://gyazo.com/46f33a041886e4b119cbbe55d2d65cc5

Actually it was the command line, use a script to work

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.