Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GetWayPoints is not a valid member of Path ?

Asked by 5 years ago

I'm doing a PathFinding script but i dont know why i'm keep getting that error "GetWayPoints is not a valid member of Path" So if u knwo how to fix that Help me :)

Code :

local pathService = game:GetService("PathfindingService")



local finish = workspace.ici


function followPath(path)

local points = path:GetWayPoints()

for index, point in pairs(points) do

if point.Action == Enum.PathWaypointAction.Walk then

script.Parent.Humanoid:MoveTo(point.Position)

script.Parent.Humanoid.MoveToFinished:Wait()

end

if point.Action == Enum.PathWaypointAction.Jump then

script.Parent.Humanoid.Jump = true

end

end

end



while wait() do

local getPath = pathService:ComputeRawPathAsync(script.Parent.HumanoidRootPart.Position, finish.Position, 500)

followPath(getPath)

end

1 answer

Log in to vote
0
Answered by 5 years ago

It's just a simple typo, GetWaypoints() instead of GetWayPoints(). It's useful to check the API when you get that error to see if you typed it incorrectly.

0
thx AfraiEda 8 — 5y
Ad

Answer this question