This started a while ago when I was using the old pathfinding (not the new one that was just released today) where a path just wasn't generated when the finish point was somewhat above the starting point. I thought the updated pathfinding would fix this problem, but it's still the same. I have zombies that chase you, but they just stop when you jump or you're above them. Here's the code, check it out and please help me figure out what's wrong!
wait() local enemies = script.Parent.EnemyFolder.Value function findNearestTorso(pos) local list = enemies:GetChildren() local torso = nil local dist = 1024 local temp = nil local human = nil local temp2 = nil for x = 1, #list do temp2 = list[x] if (temp2.className == "Model") and (temp2 ~= script.Parent) and game.Players:GetPlayerFromCharacter(temp2) then temp = temp2:findFirstChild("HumanoidRootPart") human = temp2:findFirstChild("Humanoid") if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then if (temp.Position - pos).magnitude < dist then torso = temp dist = (temp.Position - pos).magnitude end end end end return torso end while wait() do if script.Parent ~= nil then local target = findNearestTorso(script.Parent.HumanoidRootPart.Position) if target then local path = game:GetService("PathfindingService"):FindPathAsync(script.Parent.HumanoidRootPart.Position, target.Position) local waypoints = path:GetWaypoints() if #waypoints > 2 then script.Parent.Humanoid:MoveTo(waypoints[3].Position) if waypoints[3].Action == Enum.PathWaypointAction.Jump then script.Parent.Humanoid.Jump = true end elseif #waypoints >= 1 then script.Parent.Humanoid:MoveTo(waypoints[2].Position) if waypoints[2].Action == Enum.PathWaypointAction.Jump then script.Parent.Humanoid.Jump = true end end end end end