Any alternatives to NetworkOwnership?

Hi.

My game uses NetworkOwnership as players kick a ball, but I noticed when one player wins it back they win it from really far on others screen, and NetworkOwnership has been laggy for me in general. Is this due to input lag?

Any help would be appriciated, thanks!

1 Like

Do you set the network ownership to nil as the player kicks the ball?

2 Likes

No I don’t, I check if the player doesn’t own the ball as they kick it, and if they don’t own it they get network ownership.

1 Like

That’s the problem. The previous owner of the ball still has ownership so the position of the ball has to be sent from ClientServerClient instead of ServerClient. Hopefully I’m correct? I haven’t really worked with NetWorkOwnship on a large scale

Yes, you are right. If i set the ownership to nil it will break for some reason.

Do you use touched events to check when to change network owner?

Yes, I fire a remote event when the ball touches the players leg

So, the ball is client sided? Setting the network owner to nil wont work because fireserver can only be called on the client.

no its server sided.
char limit

So the “Puck” Object will be the ball? Ill try this out when im on computer, thanks!

How do I implement this?? This is my current script:

if not ReactDeclined and not Cooldown and Distance < 10 then -- ReactDeclined is when the players ping is too high, Distance checks from the ball as well 
		SoundEvent:FireAllClients(true)
		ReactModule:BallEffect(ball)
		if ball.Owner.Value ~= player then -- Owner is an ObjectValue, it checks if the value doesn't equal the player
			ReactModule:MakeReactBubble(player , ball)
			ReactModule:BallEffect(ball)
		end

Module script:

function React:MakeReactBubble(player , ball)
	ball:SetNetworkOwner(player)
	SoundEvent:FireAllClients()
	ball.Owner.Value = player
	ball.Cooldown.Value = true
-- other useless code that works below here
end