Hello I am trying to recreate rocket league, and I am struggling with smoothly changing the ball’s network ownership. I want players to be able to challenge for the ball without it teleporting each time someone touches it. I have attempted to make the ball owner send the ball’s position to each client every frame but that did not work.
Providing network ownership over a crucial object like the ball will allow exploiters to manipulate the ball freely. Teleporting it and instantly scoring. I’d suggest you checking out if network ownership assigned to the server is good enough latency wise for your game’s case.
Nope, having the ball’s network on the server will result in it being extremely jittery and isn’t playable.
Okay, in this case, what comes to my mind is making a proximity system, that will check the players around the ball in a specific radius. If a player is within a threshold it will assign the ownership to the player. You also could try testing :SetNetworkOwnershipAuto()
Also take in mind that when SetNetworkOwnershipAuto is used, the engine dynamically decides whether the ownership is going to be the server or a client. Make sure that you don’t mess with properties of the ball on the server side in this case, or it will prioritize the server.
I don’t think this will work because :SetNetworkOwnershipAuto() will result in the ball’s ownership changing to another player even if they don’t touch it which might cause it to completely stop if for example player1 shoots it above player2 without it touching player2.
The proximity approach could work likely. Let me know how it goes ![]()
Still stuck on this any help would be appreciated
I remember a while back skimming some of this video out of curiosity. It goes over how they handle ball and car physics, and most importantly, networking. Rocket league uses lots of client-sided prediction to estimate where the ball will go.
To implement the techniques used in RL you’d likely need to handle physics and replication yourself. As a starting point I’d look into UnreliableRemoteEvents and buffers to send information to each client about the ball.
This is a very complex solution and quite honestly doesn’t mesh well with Roblox’s in house physics and replication. I don’t know of any way to cleanly handle physics between several players accurately without just doing it all yourself.
Thanks for the detailed response, but I don’t even know where to begin and don’t think it’s possible for me to create a system like this. rocket league managed to use a different physics engine which they edited to make it work better.
There has to be a simpler solution.
As long as you know the ball behavior and physics, you can attempt to mask this effect by making predictions for where the ball should be, based on certain metrics and factors like player ping. When you get the real result from the server, simply update the ball position from the predicted one to the actual one, but in a smooth manner. Obviously the higher ping a client has, the less accurate your predictions will be. But this problem exists on the actual Rocket League game as well(if the ping is high you see both the ball and the car teleport).
Also if you think that the physics calculations take long and might influence this, you can attempt to make custom physics and collisions that are simpler in nature but still enough for the game to be playable.