Part floating in air

So I’m trying to set the part ownership to the player if the weld gets destroyed but the part still floats in the air.

Client:

local function breakWeldConstraint(part, otherPart)
	for i,v in ipairs(part:GetChildren()) do
		if v:IsA("WeldConstraint") then
			v:Destroy()
		end
	end

	for i,v in ipairs(otherPart:GetChildren()) do
		if v:IsA("WeldConstraint") and v.Part1 == part then
			v:Destroy()
		end
	end
	
	script.SetNetworkOwner:FireServer(part)
	script.SetNetworkOwner:FireServer(otherPart)
end

for i,v in ipairs(Parts:GetChildren()) do
	if v:IsA("BasePart") then
		v.Touched:Connect(function(hit)
			breakWeldConstraint(v, hit)
		end)
	end
end

Server:

script.Parent.SetNetworkOwner.OnServerEvent:Connect(function(player, part)
	if part then
		part:SetNetworkOwner(player)
	end
end)

My recommendation is to ensure SetNetworkOwner is run on the server. Just because a client says it owns a part doesnt mean the server is gonna listen to them and hand over the part

Also, you in your second iteration loop within breakWeldConstraint, id double check v.Part1 == part isnt throwing your v:Destroy for a loop. Throw print statements everywhere and ensure all flag prints are running when they should.

All of the code works fine.

I put a print here and it worked fine:

script.Parent.SetNetworkOwner.OnServerEvent:Connect(function(player, part)
	if part then
        print(part) <-------
		part:SetNetworkOwner(player)
	end
end)