How to Smoothly transfer NetworkOwnership without Visual Lag?

I’m using AlignPosition | Documentation - Roblox Creator Hub to move the Ball. I want the Ball to be smooth for all Players, currently using Network Ownership | Documentation - Roblox Creator Hub to achieve this but I’ve ran into some issues. I’ve tried the following:

  1. If I set NetworkOwnership to nil:
    – It is constantly lagging on each hit, therefore a NetworkOwner is required.

  2. If I swap NetworkOwnership to the Ball’s Target, swapping back and forth:
    – The Ball has visual initial lag for the Player that hit it, as that is when the NetworkOwnership is swapped to the opposite player, however the Hitboxes are accurate for the Ball’s Target Player.

  3. If I set NetworkOwnership to the first Ball’s Target, never swapping it:
    – The Ball’s movement is smooth, however the Hitbox is not aligned and will often hit the Player before it visually hits them, unless they are the Network Owner.

Below is a video displaying 2. and 3.

I’m not sure what to do, I have tried task.delay to switch the NetworkOwner mid-way but it is still very janky. Not sure if what I want is even possible. This is to recreate Blade Ball’s Physics. If there’s a better method for what I want please let me know, thanks!

This is a problem with latency and is the main problem with multiplayer games, I have often seen this playing fighting games (taking damage before visually being hit). There is no true way to fix this.
What would probably be best is to handle the collisions on the server so that every player has an even playing field.
You can also search up how to fix multiplayer latency to try and get some information.
I found this: https://www.reddit.com/r/explainlikeimfive/comments/16i88v5/eli5_how_does_online_multiplayer_games_solve/
which talks about predictive code, and that might be a good idea in your case, if complicated. Get the client to render a ball where it thinks the ball will be before the server tells it where the ball really is.
You also can try experimenting with different movement options to see if that sidesteps the issue. But I can’t help more as I don’t know enough.
Good Luck.

2 Likes