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
So what am I doing wrong??