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

How to implement jumping over obstacles in a pathfinding script?

Asked by 6 years ago

Hello! I'm extremely new to pathfinding and I'm trying to learn. One thing I don't understand is how you would make NPCs jump over obstacles when they meet them. What's the best way to do this? Thanks.

local pathFinding = game:GetService("PathfindingService")
local start = script.Parent.Torso

local path = pathFinding:FindPathAsync(start.Position, workspace.partt.Position, 500)
local waypoints = path:GetWaypoints()

for _, waypoint in pairs(waypoints) do
    local waypointPosition = waypoint.Position
    script.Parent.Humanoid:MoveTo(waypointPosition)
    script.Parent.Humanoid.MoveToFinished:Wait()
end 
0
you could use Region3 NsNidPL 41 — 6y

Answer this question