Currently working with Pathfinding but for some reason this pea brain
won’t go to the target part. I have set up some obstacles that is COMPLETELY possible by a normal player (jumping, climbing, ect.) but he wont go to the target part. Please help, I’ve always had this issue with Pathfinding and I just need the solution.
CODE:
function FindPath(target)
local Params = {
["AgentRadius"] = 4.0;
["AgentHeight"] = 5.0;
["AgentWalkableClimb"] = 2.0;
["AgentCanJump"] = true;
["WaypointSpacing"] = 4.0;
}
local path = pathfindingService:CreatePath(Params)
path:ComputeAsync(humanoidRootPart.Position, target.Position)
if (path.Status == Enum.PathStatus.Success) then
for i, waypoint in pairs(path:GetWaypoints()) do
if (waypoint.Action == Enum.PathWaypointAction.Jump) then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
humanoid:MoveTo(waypoint.Position)
humanoid.MoveToFinished:Wait(2)
end
end
end
while true do
FindPath(FindTarget())
end