SetNetworkOwner not working on pets

I create pets on the server

-- Create a clone of the pet & set network owner
local SpawnedPetModel = Assets.Pets[PetData.ModelName]:Clone()
SpawnedPetModel.Parent = workspace.ActivePets

SpawnedPetModel.PrimaryPart:SetNetworkOwner(player)

I update the pets position then on the client using RenderStepped. However, on other clients you can’t see the pet (pet is stuck in the same spot where it spawned in)

RunService.RenderStepped:Connect(function()
	if not Player.Character then return end
	
	if not Player.Character:FindFirstChild("HumanoidRootPart") then return end
	
	local HumanoidCFrame = Player.Character.HumanoidRootPart:GetPivot()
	
	for petIndex, activePet in pairs(self.ActivePets) do
		local PetPosition = (HumanoidCFrame * CFrame.new(PET_OFFSETS[petIndex])).Position
		
		-- Raycast then handle the result
		local Raycast = workspace:Raycast(
			PetPosition + Vector3.new(0, 15, 0),
			Vector3.new(0, -30, 0),
			Params
		)
		
		local NewPetPosition 
		if Raycast then
			NewPetPosition = Raycast.Position
		else
			NewPetPosition = PetPosition - Vector3.new(0, Player.Character.Humanoid.HipHeight + 1.5, 0)
		end
		
		-- Lerp the position
		local YOffset = -activePet.PetInstance.PrimaryPart.Floor.Position.Y + Pets[activePet.PetInstance.Name].AboveGroundY
		local NewCFrame = CFrame.fromMatrix(NewPetPosition + Vector3.new(0, YOffset, 0), HumanoidCFrame.RightVector, HumanoidCFrame.UpVector)
		local LerpCFrame = activePet.PetInstance.PrimaryPart.CFrame:Lerp(NewCFrame, 0.078)
		
		activePet.PetInstance:PivotTo(LerpCFrame)
	end
end)

To my knowledge, SetNetworkOwner should mean that whatever player has the ownership, any changes I make would be replicated to all clients, so I am unsure why it isn’t :confused: So what am I doing wrong??

Assuming all of the model is under networkownership of the player from server script and unanchored the behaviour you want should be happening. Try doing GetNetworkOwner on renderstepped to see what it’s printing

It prints my player. The pet works great on my client, it’s just other clients where movement is not being replicated at all :confused:

The network ownership dictates who calculates the physics for a BasePart. I presume that you are doing

… from the client? Because if so, this code will not be replicated.

Instead you can make it follow the player with BodyPosition for example. This way, you can let the pet chase a target position and have the owner as a network owner.

So I can’t just set a CFrame?? I hate using BodyMovers as they are beyond unreliable and often cause objects to act in weird and frustrating ways

You would have to set the CFrame from the server for it to be replicated.

Can you send me a picture of the pet? Maybe I can think of another solution. BodyMovers should act fine as long as your calculations are sound and collisions are not interfering.