Bumping this 7-year-old post as I seriously think that having PathfindingService factor in JumpPower/JumpHeight and potentially gravity is essential.
I’m attempting to program AI for my game, but they just keep getting stuck since my game uses a custom jump height and gravity that PathfindingService isn’t accounting for.
This is an issue that has fully crippled my games AI potential, making me have to entirely scrap the idea due to the lack of a most basic and essential feature in Pathfinding.
Adding onto this, maybe when you create a path, JumpHeight
should be a variable you can input, which is simply the Height in Studs the agent can jump. Defaults to the default 7.2 studs.
pathfindingService:CreatePath({
AgentRadius = 3,
AgentHeight = 6,
AgentCanJump = false,
AgentJumpHeight = 7.2,
Costs = {
Snow = math.huge,
Metal = math.huge,
},
})
Why this is needed:
As you can see in this screenshot, my agent wants to jump up onto the platform, however this screenshot was also taken at the exact moment he hit his maximum jump height.
Factoring in the movement to move over to the next waypoint after jumping, and this jump simply isn’t possible, and would cause the agent to get stuck.
Recomputing the same path will result in the agent yet again getting stuck, so the only workaround to this would to be to recompute without the ability to jump, but since this issue happens in 90% of all jumps of my games maps, I’d essentially just be fully disabling the ability for my bots to jump.