Network Ownership API cannot be called on Anchored parts or parts welded to Anchored parts

Hello, y’all. I have problem with ‘SetNetworkOwner’ function. It gives me an error ‘Network Ownership API cannot be called on Anchored parts or parts welded to Anchored parts.’ There is no anchored parts or else.

Code:

script.Parent.ChildAdded:Connect(function(child) --It's a folder.
	local Player = Players:GetPlayerByUserId(tonumber(script.Parent.Name)) --Folder name is player id
	if not Player then return end

	local Character = Player.Character
	if not Character then return end
	
	local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
	if not HumanoidRootPart then return end

	local petPrimary = child.PrimaryPart --Pet's main part/primary part
	
	petPrimary:SetNetworkOwner(Player) --Problem
end)
1 Like

The error is literal, either the primary part is welded or anchored, have you double checked?

1 Like

Yes, i checked. (blalbabababababababababa 30 letters)

Post a screenshot of the primary part children.

Any motors/weld inside the primary part or is something else welded to it?

Yes, the model is welded together

Then that’s why it’s erroring. Parts need to unwelded or unachored in order to set network ownership.

I cleared the welds and its still same

Can’t hurt to make sure:
Ensure that child is actually unanchored. You can check that with a script like this:

if child:IsA("BasePart") then
   child.Anchored = false
else
    for _, desc in ipairs(child:GetDescendants()) do
        if desc:IsA("BasePart") then
            desc.Anchored = false
        end
    end
end

How is the Pet moved?
I’ve seen many pet scripts that CFrame an anchored pet to move it with the player.

Still same error… (adsa 30 letters)

I used AlignPos and Orientation.

Not sure if misunderstood, but you could do “not :CanSetNetworkOwnership()” if you’re looking for a basepart who just won’t SetNetworkOwnership()
Btw I’ve never had issues setting network ownership to parts with welds and who is welded to anchored parts.

for _,BasePart in pairs(yourPet:GetDescendants()) do
	if BasePart:IsA("BasePart") and not BasePart:CanSetNetworkOwnership() then
		print(BasePart.Name)
	end
end