Hi there! So I have this basketball thing where you try to shoot the ball into the hoop. The shooting part works, however, after shooting, sometimes, it stays in the air and doesn’t come back down:
This is me shooting the ball:
https://gyazo.com/4450970b95bf9adee25c0985e760a68c
After shooting, the ball just floats, like shown below
It is not anchored, (I checked in workspace) and there are no errors in console.
Here is the code I use to move the ball after point is scored:
if InPlay then
if ScoringTeam == 1 then
Ball.CFrame = CFrame.new(FreeThrow2.Position + Vector3.new(0, 10, 0))
else
Ball.CFrame = CFrame.new(FreeThrow1.Position + Vector3.new(0, 10, 0))
end
end
Ball.Velocity = Vector3.new(0, 0, 0)
Ball.AssemblyAngularVelocity = Vector3.new()
Ball.Variables.Disabled.Value = false
Ball.Variables.InAir.Value = true
Ball.Variables.LastTeam.Value = 0
Ball.Variables.Shooting.Value = false
print("ResetBall")
end
end
It should just fall to the ground.
Also, keep in mind that it only sometimes happens, so the code itself works, it’s just that for some reason, sometimes the ball just floats in the air.
Another weird thing is that if you jump around it, you don’t touch it or anything, just jump close to it, it falls down to the groud:
https://gyazo.com/b42f82603a9db4ba8173d9d160072e24
So I am confused. Is this a roblox error, or something I’ve done wrong with the code?
Any help is appreciated