#Pathfinding being weird

1 messages · Page 1 of 1 (latest)

vale radish
#

I'm using built-in pathfinding and a tutorial. I've never done pathfinding before so I'd really like help with this.

#

This is my script;

local PathfindingService = game:GetService("PathfindingService")
local SCP = script.Parent
local Humanoid = SCP.Humanoid
local hrp = SCP.HumanoidRootPart
local Point = game.Workspace.waypoint
local Path = PathfindingService:CreatePath({
AgentRadius = 1,
AgentHeight = 1,

})

Path:ComputeAsync(hrp.Position, workspace.waypoint.Position)

if Path.Status == Enum.PathStatus.Success then
local waypoints = Path:GetWaypoints()

for i, waypoint in waypoints do
    local p = Instance.new("Part", workspace)
    p.Position = waypoint.Position
    p.Anchored = true
    p.Material = Enum.Material.Neon
    p.CanCollide = false
    p.Size = Vector3.new(1,1,1)
end

for i, waypoint in waypoints do
    Humanoid:MoveTo(waypoint.Position)
    Humanoid.MoveToFinished:Wait()
end

else
warn("Path not computed")

end

#

This is where the script is.

vale radish
#

Can anybody help me with this?

umbral flare
#

Humanoid.MoveToFinished:Wait()
no wonder you're having issues

vale radish
#

I was watching a video because I found that easier to understand. And they used the exact same script and it worked.

#

But thanks.

chilly sundial
vale radish
#

What?

vale radish
#

Also none of this really helped me.

#

I am still having the same issues, even while using the written code in the documentation.