Is there anyway to adjust the distance of one waypoint to another?

Is there anyway of implementing such thing? If yes, can you give me an idea of how? If no, then I’m thinking of just skipping every other waypoints.

This is what I have and I want to tween the HumanoidRootPart to kind of like hop to the next waypoint.

local TweenService = game:GetService("TweenService")
local PathfindingService = game:GetService("PathfindingService")

local animateEvent = game.ReplicatedStorage.AnimateEvent

animateEvent.OnServerEvent:Connect(function(player, destination)
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChild("Humanoid")
	local rootPart = character:FindFirstChild("HumanoidRootPart")
	local tween = TweenService:Create(rootPart,,Enum.EasingStyle.Sine),{Position = rootPart.Position +,2,0),Orientation =,0,0)})
	local path = PathfindingService:CreatePath()
	local waypoints = path:GetWaypoints()
	for i, waypoint in ipairs(waypoints) do		
		local part ="Part")
		part.Position = waypoint.Position
		part.Anchored = true
		part.CanCollide = false
		part.Size =,1,1)
		part.Shape = Enum.PartType.Ball
		part.Material = Enum.Material.Neon
		part.Parent = workspace
		if waypoint.Action == Enum.PathWaypointAction.Jump then
			humanoid.Jump = true
		if humanoid.WalkToPoint ~= waypoint.Position then break end
1 Like

Maybe you could try doing this? (in a nutshell, i += 2 every time the loop runs, thus skipping every other number)

for i = 1, #waypoints, 2 do 
    local waypoint = waypoints[i]
    -- rest of code

If you want to adjust the distance between waypoints to a specific number, you can put in parameters of the CreatePath function with a dictionary of agent parameters.

Options of agent parameters are on the top of the page of:

You can tweak the WaypointSpacing parameter like so:

local pathParameters = {
[“WaypointSpacing”] = <specific distance you want>


(Note: You can raise this distance to a ridiculously high number but it will still adjust to any turns or corners that the path has to stop any ‘stuck’ issues)


can you explain it further more i don’t quite understand what u trying to say

Sure thing. When you using PathfindingService:CreatePath(), you can pass in a table of values which determine the “agent” (the npc walking using pathfinding in this case) features. These features range from how hypothetically wide the agent is (AgentRadius) to whether or not the agent can jump (AgentCanJump).

One of the available features that Roblox allows you to plug in is the WaypointSpacing, which forces the NPC/Agent to make one waypoint every certain studs when you call the Path:GetWaypoints() function. (For example, if you put the WaypointSpacing as 5 studs, it will create a line of waypoints to the destination, each one being exactly 5 studs away from one another).

However, sometimes the path to the destination can have turns, and if the path is forced to comply with the WaypointSpacing parameter at all times, it would be impossible to consistently make a sharp, efficient turn (the forced spacing will make the agent overshoot the corner). Hence, WaypointSpacing forces the waypoints to be a certain distance from each other only when no difficulties in the path make it inefficient.

And please check out the link to the documentation if this is still unclear, they probably explains it better than I can anyway.