HingeConstraints not replicated properly

So, I have a helicopter. When the pilot first enters it, a remote is fired to the server to give the player network ownership. Everything is setting; the player has complete network control over the helicopter, or atleast over all the baseparts. I feel this may be the issue, but I don’t know of any other class that has network ownership.

When the player starts the helicopter, the blades will rotate on the client, but not on the server. The blades are controlled by a hingeconstraint, and I can see through the server that it is not getting replicated. This is super odd to me, since I’ve done this exact process before with a propeller plane. Can some things be cleared up about how hingeconstraints act on network ownership? Do they share the same network owner as their parent part?

This piece of code sets and verifies network ownership. I can see the player has it the entire time.

game.ReplicatedStorage.Remote.DriverSit.OnServerEvent:Connect(function(plr,seat)
	if seat then
		local vehicle = seat.Parent
		print("Setnetwork")
		for _,part in pairs(vehicle:GetDescendants()) do
			print("thing",part)
			if part:IsA("BasePart") then
				print("setting",part)
				part:SetNetworkOwner(plr)
				
			end
		end
		
		repeat
			for _,part in pairs(vehicle:GetDescendants()) do
				if part:IsA("BasePart") then
					print(part,part:GetNetworkOwner())
				end
			end
			wait(5)
		until nil
	end
end)

I’ve also tried manually setting each assembly, blades included, to network owner. This did not work.

I am able to move the entire assembly on client and it replicates, only the blades are problematic.

Was randomly shifting around the helicopter on server side, and it appears something clicks and the propeller blades start moving after dragging the helicopter on server side, and then eventually stop moving. Is this a bug?

Try this:

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Functions
ReplicatedStorage.Remote.DriverSit.OnServerEvent:Connect(function(player, seat)
	if not seat then
		return
	end
	
	print("Set network")
	seat:SetNetworkOwner(player)
	
	local Vehicle = seat.Parent
	
	repeat
		for _, part in ipairs(Vehicle:GetDescendants()) do
			if part:IsA("BasePart") then
				print(part, part:GetNetworkOwner())
			end
		end
		
		task.wait(5)
	until nil
end)

I’ll try this when i’m home.

Does setting the seats network owner also set parts attached to it via hingeconstraints? This was what I was worried about when looping through descendants.

Yes, only if you welded/hinged it together properly.

1 Like

There is no effect. Considering it’s still doing the exact same thing, this is not a shocker.

This is resolved. The underlying issue was from my proximity prompt seat system, which welded the character to the seat on client-side. Welding on serverside fixed this issue.