Network Ownership getting transferred after being manually set

So I’ve been working on my game Box Racers however I have run into a problem. When a box gets spawned, the network ownership gets set to the player. This is the code that sets the network ownership

for i,v in ipairs(newBox:GetChildren()) do
	if v:IsA('Part') and v.Name ~= "CollisionBox" then
		v.Color = player:FindFirstChild('BoxSettings').Color.Value
		PhysicsService:SetPartCollisionGroup(v, CollisionGroupSave)
		v:SetNetworkOwner(player)
	end
end

The problem occurs when another person collides with your box. This results in the total transfer of network ownership. This causes your box to spin out of control and lag, which results in an un-optimal gaming experience.

The screenshot below shows the before, when you check the network ownership, and after you get hit, when you check the network ownership


image

Generally this happens when both boxes collide with one another while moving in the general same direction
image

So I have 3 questions in which I hope can be answered

  1. Is there a way to make sure that network ownership will stay to a specific client
  2. Is there a way to detect when network ownership changes through a script
  3. Is there a way to bypass this entirely?

Are the parts welded together? Maybe it’s bugging out because you’re setting network to multiple

A way to make sure the network ownership doesn’t get changed at all is to use SetNetworkOwnershipAuto on the part. Although this is a very unlikely scenario too because of the fact that SetNetworkOwner should be doing this automatically for you.

So I don’t think the issue is the network ownership itself there might be a problem with something else. It could be something wrong with the collision box itself (maybe it’s something up with the UnionOperation or maybe the shape of the mesh part is off) or maybe your script isn’t working correctly.

Edit: Sorry for double forum post, my internet started acting up horribly.

Problem is most likely sourced from the fact that networkownership is automatically set when a client is in a certain radius of an physics object. Make sure you set it on the server as it manages it. You can set it to the server, however that can lead to slow performance.

Otherwise, safe to say it’s because ROBLOX sets the ownership if it’s not owned by the server. Hope that helps, there isn’t much features in the way of networkownership.

Yes the parts are welded together, that’s an interesting thought I have not thought about yet.

I will try that out

That’s also a good idea to mess around there

Yes, I understand that fact. However, when you set it to the server it has the undesirable physics effects. So I am trying to keep it on the client. Although it really shouldn’t just randomly switch over

Agreed, there should be more features in network ownership!