Ball Physics Help

I am scripting a football and it shoots perfectly when I stand still. However when I am walking, the ball bounces and glitches.
I also notice the ball is really laggy, it freezes in mid-air or rolling in land.
I used this script to add a BodyVelocity on the ball.

    local BV = Instance.new("BodyVelocity")
    	BV.Velocity = Char.HumanoidRootPart.CFrame.lookVector * 25 * velo + Vector3.new(0, 40 * velo, 0)
    	BV.Parent = script.Parent
    	Debris:AddItem(BV, 0.1)

I tried setting the NetworkOwnership to nil but it seems even worse.


Thanks in advance.

4 Likes

If the ball lags or freezes then, it’s involved in network ownership, try disabling network ownership so it won’t move on the nearby player.

1 Like

Yeah to add on, if you notice as the ball rolls a certain distance away from the player you can notice the switch from client ownership to server ownership as seen in the first video, this causes the freezing as the server now has to calculate the physics and stuff.

1 Like

I just changed the ball’s NetworkOwnership to the player, it’s smoother now but the delay still exists.
Sometimes the ball works really well but sometimes it’s terrible especially when the player is walking.
What should I do now?

1 Like

You could try distancing the ball from the player when the ball is being released, Or making it so. when the ball is released it has like a CanCollide off wait time. So it doesn’t collide with the character.