PathFindingService not moving rig

Hello, I want to learn how to use the pathfinding service and test it on studio, but the rig will not move when I run the project. I tried reading this:

but this didn’t work for me. This is my script so far:

local pathfindingservice = game:GetService("PathfindingService")

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

local path = pathfindingservice:CreatePath()
path:ComputeAsync(torso.Position, game.Workspace.EndPart.Position)
local waypoints = path:GetWaypoints()

for i, waypoint in pairs(waypoints) do
	humanoid:MoveTo(waypoint.Position)
end

humanoid:MoveTo(game.Workspace.EndPart.Position)

If anyone could help me out, that would be really appreciated. Thanks for reading this!

Never mind, I figured it out! Some of the body parts were anchored.