Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

GetWayPoints is not a valid member of Path ?

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

✓ Accepted answer

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.

1 comment

0

thx

This discussion is preserved as it was. New answers, comments, and votes are closed.