Unanchored part inconsistently doesn't move

In my football game sometimes when I kick the ball, it either doesn’t move at all and stays in the exact cframe where I kicked it, or moves like normal. This also changes depending on the player. For example, when I kick the ball it could be seamless, but if a friend does the same, the bug occurs. sometimes it doesn’t move consistently, and other times it moves consistently. It is not a ping issue, as all my friends live close together and are under 60 ping at all times.

Here, the bug is CONSISTENTLY happening even though my ping is low?? It makes no sense.
But today the bug didn’t appear at all for me but for other players it did.

This is the script i’m using to shoot:

if Character:FindFirstChild("HasBall") then
		local ball = workspace.TestBall
		create("Unrecievable", ball, 0.6)
		ball.CanCollide = true

		if Character:FindFirstChild("HasBall") then
			Character.HasBall:Destroy()
		end
		if Character.HumanoidRootPart:FindFirstChild("BallPossession") then
			Character.HumanoidRootPart.BallPossession:Destroy()
		end
		if Character:FindFirstChild("OwnerCircle") then
			Character.OwnerCircle.Transparency = 1
		end
		if Character:FindFirstChild("OwnHL") then
			Character.OwnHL:Destroy()
		end

		ball:SetNetworkOwner(player)
		ball.CFrame = cframe * CFrame.new(0, -1, -2)



--------------------------

		
		--A bunch of shooting accuracy and force logic goes here and does NOT error
		

----------------------------




		local attachment = Instance.new("Attachment")
		attachment.Parent = ball

		local linearVelocity = Instance.new("LinearVelocity")
		linearVelocity.Attachment0 = attachment
		linearVelocity.VectorVelocity = totalVelocity
		linearVelocity.MaxForce = math.huge
		linearVelocity.RelativeTo = Enum.ActuatorRelativeTo.World
		linearVelocity.Parent = ball

		game.Debris:AddItem(linearVelocity,0.5)
		game.Debris:AddItem(attachment,0.5)

		SoundManager.PlayKick(Character.HumanoidRootPart)
		EffectsManager.Kick(Character)

		ball.Taken.Value = false
		create("SlowDown", Character, 0.1)
		create("CantShoot", Character, 0.3)
		
	end

This is most likely due to Network Ownership.
I suggest you reading this article: Network ownership | Documentation - Roblox Creator Hub
What you can do is that when a player obtains the ball, make him that ball’s network owner so that the client could apply physics locally.

Oh so I should apply the ball physics in the local script rather than firing a remote event to the server to handle the ball physics? I didn’t think of that , thanks i’ll try rn

Yes, It will be more responsive to the one kicking the ball. But make sure that that client has the network ownership of that object.

Would it make be viable to use a modulescript in replicated storage and require it? because actually doing it in the local script would be very cluttered as opposed to requiring the module in the local script

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