Network Ownership and Hockey

Hello! I’m trying to solve a problem involving a small hockey game I play in.

The issue is that players seem to be able to gain complete control over the puck, where nobody else can move the puck. Additionally, I can spot noticeable hops which seem to correlate with my ability to be able to hit the puck. I believe it’s something to do with Network Ownership. To try to solve this, I wrote this script and it was put into every puck (about 10 in the game at one time):

function PuckNetworkOwnership()    
    while true do 
        script.Parent:SetNetworkOwner(nil) 
        wait(1) 
    end     
end

It doesn’t seem like that fixed it, so I have a few questions:

  1. Do I need to set the network ownership every second? I assumed when writing the script that Roblox would try to set the network owner back to automatic as soon as I set the network owner.

  2. Should I be setting the network owner to a neutral third party, like a referee, instead of the server?

Thanks

No jsut do it once. Not every second

Call SetNetworkOwner() with no arguments to set network ownership to the server itself.

That should prevent Roblox from setting it automatically right?

If you’re doing loose puck (meaning the puck is an unanchored part and you’re trying to whack it with a tool) don’t set it to nil otherwise players won’t be able to fluently interact with the puck at all as the player won’t be anywhere near the puck is on the server and they’ll practically be hitting at nothing. Try to every so often, whether it be .1 seconds, etc set it to the nearest stick or person’s torso location to make it rendered by the person closest to the puck.

1 Like

That sounds like a good solution, thank you.

Np, Ro-Hockey community won’t die on my watch. ; )

Good luck with your game bud, looking forward to seeing what you will do with it :eyes: