#Why won't it follow the path with pathfinding?

1 messages · Page 1 of 1 (latest)

narrow galleon
#

local PathfindingService = game:GetService("PathfindingService")
local Workspace = game:GetService("Workspace")

local Rig = Workspace:WaitForChild("Rig")
local Humanoid = Rig:WaitForChild("Humanoid")

local GoalPart = Workspace:WaitForChild("Goal")

local Path = PathfindingService:CreatePath()

local Success, Error = pcall(function()
Path:ComputeAsync(Rig.PrimaryPart.Position, GoalPart.Position)
end)

if Success then
for _, Waypoint in pairs(Path:GetWaypoints()) do
Humanoid:MoveTo(Waypoint.Position)
Humanoid.MoveToFinished:Wait()
end
else
warn(Error)
end

surreal cargo
#

any error

narrow galleon
#

no

#

just running through the wall

#

not going around

#

to the end

surreal cargo
#

give the humanoid ability to jump?

narrow galleon
#

let me check

grizzled helmBOT
#

studio** You are now Level 2! **studio

narrow galleon
#

yep

surreal cargo
#

does it work now?

narrow galleon
#

nope

#

i tried to put the script in the rig but still wont work

surreal cargo
#

is cancollide or canquery of the part the rig keeps running into true?

narrow galleon
#

yes

narrow galleon
#

ty man its working!