Pet system breaking when adding Humanoid

I have a Walking Pet System, which works fine! The issue here is that when i add a Humanoid in the pet, the pet doesn’t works. Here is a portion of the script. The error is in the line marked as “Breaking Line”:

local TweenService = game:GetService("TweenService") --
local FollowTween, TurnTween --
 --
local Player = game:GetService("Players").LocalPlayer --
local PetObj --
 --
local Distance = 5 --
 --
local isMoving = Instance.new("BoolValue") --
local isJumping = Instance.new("BoolValue") --
 --
script.Parent.OnClientEvent:Connect(function(Obj)
	PetObj = Obj
	game:GetService("RunService").RenderStepped:Connect(function()
		if PetObj["Base"] ~= nil then else return end
		UpdateTween()
		UpdatePetObj()
	end)
end)

function UpdateTween()
	--[[Breaking line]] FollowTween = game.TweenService:Create(PetObj["Base"]["BodyPosition"], TweenInfo.new(0.25, Enum.EasingStyle.Linear), {Position = Player.Character["HumanoidRootPart"].CFrame.p - Player.Character["HumanoidRootPart"].CFrame.LookVector * Distance})
	TurnTween = game.TweenService:Create(PetObj["Base"]["BodyGyro"], TweenInfo.new(0.25, Enum.EasingStyle.Linear), {CFrame = CFrame.new(PetObj["Base"].CFrame.p, Vector3.new(Player.Character["HumanoidRootPart"].Position.X, PetObj["Base"].Position.Y, Player.Character["HumanoidRootPart"].Position.Z))})
end

Error printing: HumanoidRootPart is not a valid member of Model. I’m using PetFollower v02. I don’t know if i gave enough information, you can ask me more information about the system is you want. Thanks for reading.

Hi, sorry - I’ve been away for awhile due to rl responsibilities during this outbreak.

Try changing Update to:

function UpdateTween()
local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
    FollowTween = game.TweenService:Create(PetObj["Base"]["BodyPosition"], TweenInfo.new(0.25, Enum.EasingStyle.Linear), {Position = HumanoidRootPart.CFrame.p - Player.Character["HumanoidRootPart"].CFrame.LookVector * Distance})
    	TurnTween = game.TweenService:Create(PetObj["Base"]["BodyGyro"], TweenInfo.new(0.25, Enum.EasingStyle.Linear), {CFrame = CFrame.new(PetObj["Base"].CFrame.p, Vector3.new(HumanoidRootPart.Position.X, PetObj["Base"].Position.Y, HumanoidRootPart.Position.Z))})
end