Hello there,
Im having trouble with a serious problem that affects my game pretty much.
My game is based on an anime soccer with tools; the problem is that, one time i had to close my game for irl problems, but recently i re-opened it and i found out the ball was having infinite roll for some reason even tho i didnt touch the game’s studio in a while.
Altought i dont know whats causing it as i made a script to prevent the infinite roll but apparently it aint working.
This the script inside the ball:
local debris = game:GetService("Debris")
while true do
wait()
if script.Parent.Velocity.Magnitude > 0 then
wait()
item = script.Parent
local F = Instance.new("BodyForce")
F.Force = Vector3.new(-item.Velocity.X * 0.3, 0, -item.Velocity.Z * 0.3)
F.Parent = item
debris:AddItem(F, 0.3)
end
end
if any of you can help me fix it, i would really appreciate it,
forgot to mention, it doesnt really inf roll, as it stops after much time, but it should stop faster like it used tho, people been complaining they cant finish as the ball passed from the teammate keep rolling
If you want it to stop in a “sudden” manner decrease the time it takes for debris to collect it(for example from 0.3 to 0.1). If you want it to in general be slower decrease the forces of X, Z to for example from 0.3 to 0.1. Try testing multiple values until you have ideal results.
You can also mess with the physical properties of the ball, such as mass, friction etc.