Pathfinding dint work

Here is my code

local Pathfinding = game:GetService("PathfindingService")

local human = script.Parent:WaitForChild("Humanoid")
local Torso = script.Parent:WaitForChild("Torso")

local Path = Pathfinding:CreatePath()
Path:ComputeAsync(Torso.Position, game.Workspace.endingPart.Position)
local waypoints = Path:GetWaypoints()

for i, waypoints in pairs(waypoints) do
	human:MoveTo(waypoints.Position)
	human.MoveToFinished:Wait(2)
end


human:MoveTo(game.Workspace.endingPart.Position)

Here is the error
f

Any help is aperciate!

Are you using r6 or r15???

Im pretty sure I was using r15

Change your

local Torso = script.Parent:WaitForChild("Torso")

into

local Torso = script.Parent:WaitForChild("HumanoidRootPart")

Now it gives me this error
ff

Oh wait now I know whats the solution is I only have to change it to r6 thx for reminding me

Torso is only in R6 characters and LowerTorso/UpperTorso is only in R15 characters. Try using HumanoidRootPart as I think all character types have it.