Pathfinding, Character not jumping short distances

Hello, I have a question with my pathfinding script.

How can I make my npc reach the green part of platform 2

Working:

(Platform 1)

(Platform 2)

Not working:

I think my script is fine since it doesn’t give me errors, but I don’t understand why the npc can’t jump that distance

Script:

local pathfindingService = game:GetService("PathfindingService")

local humanoid = script.Parent.Humanoid
local body = script.Parent:FindFirstChild("HumanoidRootPart") or script.Parent:FindFirstChild("Torso")
local destination = game.Workspace.Finish


local path = pathfindingService:CreatePath()


path:ComputeAsync(body.Position, destination.Position)


local waypoints = path:GetWaypoints()


for k, waypoint in pairs(waypoints) do
	local part = Instance.new("Part")
	part.Shape = "Ball"
	part.Material = "Neon"
	part.Size = Vector3.new(0.6, 0.6, 0.6)
	part.Position = waypoint.Position + Vector3.new(0, 2, 0)
	part.Anchored = true
	part.CanCollide = false
	part.Parent = game.Workspace	
end




for k, waypoint in pairs(waypoints) do	

		if waypoint.Action == Enum.PathWaypointAction.Jump then
			humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		end
		
		
		humanoid:MoveTo(waypoint.Position)
		humanoid.MoveToFinished:Wait()
			
			
end

Video:

Also when the npc has to jump to platform 2 it does not move, I guess because of the pathfining not finding an easy way

Even if it’s close it doesn’t work

The Roblox pathfinder cannot make diagonal jumps. You can view the generated navigation mesh to confirm this. Polaris-Nav is a more advanced solution, but is currently in development. Testing has begun and automatic jump / fall connection generation is almost ready to be tested.

2 Likes