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

Why does my humanoid not walk the path(pathfinding)?

Asked by 4 years ago
Edited 4 years ago
local part = script.Parent

part.Touched:Connect(function(hit)
    if hit:IsDescendantOf(game.Workspace.Model2) then

        local model = game.Workspace.Model3
        local pathservice = game:GetService("PathfindingService")
        local path = pathservice:CreatePath()
        local path1 = path:ComputeRawPathAsync(game.Workspace.StartPosition.Position, game.Workspace.EndPositionPath.Position)
    local points = path1:GetPointCoordinates()
    for i,v in pairs(points) do
        local hum = model.Humanoid
        hum:MoveTo(v.Position)
        hum:MoveToFinished()
        if v.action ==  Enum.PathWaypointAction.Jump then
            hum.Jump = true 
        end
        end 

I want the humanoid to walk from the start to the end. The start position is at the model of the humanoid. I get 0 errors. The humanoid does need to jump once, though.

0
The parts of the model of the humanoid are all anchored BaconX112X 75 — 4y

Answer this question