Making a path that considers Walkspeed & JumpHeight

Hello developers. I am really new to the PathFinding service and what my main goal is to make it so When calculating a path, it also considers the Humanoid’s Walk speed and JumpHeight of the Dummy. I have tried looking at other dev forums, YouTube Tutorials and https://create.roblox.com/docs/reference/engine/classes/PathfindingService#agent-params But I can’t seem to find the answer (Which it could be right in front of me… Again, I haven’t really done anything on the Pathfinding service before this). As of right now, If the Jump is too high, the Dummy doesn’t even jump or try for it, and this is really important as I am trying to make the Dummy do an Obby with different Walkspeeds and Jump Heights. Below is my code in a function and any help is appreciated!

local function GetPaths(Part)
	local pathwayservice = game:GetService("PathfindingService")
	local path = pathwayservice:CreatePath()
	path:ComputeAsync(script.Parent.HumanoidRootPart.Position, Part.Position)
	local Points = path:GetWaypoints()

	for i, Point in pairs(Points) do 
		if Point.Action == Enum.PathWaypointAction.Jump then
			script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		end
		script.Parent.Humanoid:MoveTo(Point.Position)
		script.Parent.Humanoid.MoveToFinished:Wait(2)
	end


	script.Parent.Humanoid:MoveTo(Part.Position)
	script.Parent.Humanoid.MoveToFinished:Wait()
	return "Done"
end
1 Like

I am still having some trouble. I think is still has to do with agentParameters but I don’t know now to apply those and/or convert it into the walkspeed or JumpHeight

I think you can change the WaypointSpacing to account for Walkspeed. Since the default is 4, I would try to change it to walkSpeed / 16 * 4. If this doesn’t work then it might not be possible, but I’m not sure what the issue is.
To account for JumpHeight, I’m pretty sure it’s not possible right now. You would have to make a custom pathfinding system or use an already made one. I would maybe try to change the AgentHeight (jumpHeight / 7.2 * 5) but probably won’t work. Anything above 6.5 studs pathfinding will not jump over, no matter the JumpHeight.

2 Likes

Intresting… Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.