Zombie pathfinding just decides to not work

Okay so i want the zombie to just move to the target.

It worked before but now it just decides to not work. I think it breaks on the compute async part but it doesn’t really show any errors.

pathfindingoutput

Running2 is basically checking if the other parts of the script works.
Suspended is the status of the pathfinding coroutine
And GameBuilderLol is basically the target.

When i tried to get the status of the path it returns nopath.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

               local function moveunit()
				wait()
					if unit and unit.PrimaryPart then
						print("running")
						
						for i,survivor in pairs(game.Teams.Survivors:GetPlayers()) do
							target = survivor
							
							if (survivor.Character.PrimaryPart.Position-unit:WaitForChild("Torso").Position).Magnitude < (target.Character.PrimaryPart.Position-unit:WaitForChild("Torso").Position).Magnitude  then
								target = survivor
							end
						end

						print("running2")

							wait(0.01)
							print(target.Name)

							local path = pathservice:CreatePath()
							print(target.Name)
							
							print(path.Status)
						
						path:ComputeAsync(unit.Torso.Position, target.Character.Torso.Position)
						
						wait(0.01)
						if path.Status == Enum.PathStatus.Success then
							for i,waypoint in pairs(path:GetWaypoints()) do
								unit:FindFirstChildOfClass("Humanoid"):MoveTo(waypoint.Position)
								print("running4")

								repeat
									wait()
									print("movin")
								until (unit.PrimaryPart.Position-waypoint.Position).Magnitude <= 4.5 --or unit == nil or not unit:FindFirstChild("Torso")

								wait(unit:WaitForChild("Config").WaitAfterMove.Value)

								print("running5")
							end

						end
						end
					print("running6")
                                  end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

It sounds like there might be an issue with the pathfinding computation. I would recommend checking the following things:

1.	Make sure that “pathservice” is defined and initialized before running the function.
2.	Check that the “unit.Torso.Position” and “target.Character.Torso.Position” positions are both valid and not nil.
3.	Double check that all the required objects and scripts are properly placed and named in the workspace.
4.	If none of these work, you may want to try to use a different target to see if it makes any difference.