So my situation is I’m making an air hockey game, and it works great in studio, and semi-okay when I’m the only person in the server (but still displays a few issues).
However, when I have 2 players (or more), all moving parts rubber band so horribly. Not entirely sure why this occurs, I had previously tested the game in a server by myself with 6 pucks moving, and no rubberbanding, so I’m guessing this is to do with having another player in the server.
I’ve tried a lot of things, such as lowering the power on body movers, tweaking different values, I’ve read up on network ownership stuff, but not really sure how to approach that. I’ve thought about having the parts display locally but still not sure how I’d go about doing that without losing functionality of the game.
Here is a gif of the rubberbanding I am experiencing:
Ignore the blue paddle being silly in the corner!!!
Just wondering if there’s anything I can do, and if so could I have some details into how, especially if it’s something such as changing network owner - some links could be useful as I have never approached this before.
Rubber banding is because of setting network ownership, you’ll want to either set the ownership to the server, or make each client have it’s own puck and sync them up so that players don’t experience input lag.
I read the article, seems very useful thank you very much for linking it to me.
Just wondering, so the code written on the page which sets network owner is:
’ 1. – Set the server as the owner of the projectile
2. projectile.PrimaryPart:SetNetworkOwner(nil)’
Does this mean I could just create a script in each moving part and just type:
script.Parent:SetNetworkOwner(nil)
?
I’ll test it now by doing that, but I’ll be pleasantly surprised if that solves all the issues, and I’ll give you a fat like, lol.
when you create the puck you just need to set it’s main part to server network ownership, no need for multiple scripts (you have the right idea with :SetNetworkOwner(nil))
I’ll focus on the puck for now, and leave the paddles alone just to speed things up.
The puck is just one brick and the layout looks like this:
This is what is inside the network_owner script:
I do still seem to get rubberbanding when running the game however like you can see here:
Not sure what to try next, or if there’s anything wrong with what I’ve written. I could make each client have their own puck, like you say but I imagine that’s really tricky to convert to.
Also the puck and the paddles are ‘already made’ for now, they aren’t created in the game for now at least. They’re just there upon spawning.