SetNetworkOwner Keeps Resetting to Server

I’m trying to make my spaceship’s physics be controlled by the client when the server creates it.

The issue I am having is that after flying around a little bit, the ownership goes back to the server and the entire ship stops moving and the client cannot control the movement of the ship. Using studio’s physics settings I was able to identify this with the “Are Owners Shown” toggle.

Screenshots are results from “Are Owners Shown”.


Green box represents client owned physics. (Good)

White box represents server owned physics. (Bad)

I’ve checked for anything that could be welding to the ship and disabling them and even setting all parts in the ship to be owned by the client but I still get the same results. No one in the Dev Forum seemed to have any relevant answers to this problem and I tried researching on the API page for Networking
Even attempting to have the server give ownership back to the client every heartbeat was unable to fix this issue and instead would create a stutter effect on the ship and eventually give ownership back to the client only to freeze again.

The ship consists of a mesh and a primary part (the engine) which are welded together by the WeldConstraint. They use a BodyVelocity and BodyGyro with MaxForce/MaxTorque of 10^10. The client gives the BodyVelocity and BodyGyro an updated Velocity/CFrame every heartbeat. The only time anything is ever welded to the ship is when a bullet hits the ship in order to display a particle effect, but these bullets are given Network Ownership to the client. This issue still occurs when no bullets are fired.

Any tips for what I should look for or something that I am missing about Networking would be greatly appreciated.

2 Likes

Does it ever get anchored? Not sure if that could cause it

No the ship is never anchored at any point while I am flying from looking at the ship’s properties. I have noticed that anchoring by the server causes the network ownership to change back to the server.

1 Like

After playing around with the game a little more, I had the game display my XYZ position on the HUD and I found that it wasn’t completely random. Turns out if you go underneath the FallenPartsDestroyHeight, the server attempts to take Network ownership of the ship. To solve this I just lowered the FallenPartsDestroyHeight value.


(Above -500 Y)

(Below -500 Y)

2 Likes