Npc keeps trying to pathfind over air

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

im trying to make an advanced npc chase and attack the opposing player, having it pathfind if theres no clear route

  1. What is the issue? Include screenshots / videos if possible!

image_2025-03-08_114621792
said npc keeps trying to pathfind over air, making it not do anything and get stuck due to my system to prevent it from walking into the void


and i see no issues with the navi mesh

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

ive searched the dev forum, and i cant find anything related to this

try using a pathfinding link / modifier

I have experienced this issue, and it can happen if your AgentRadius is too big. Make sure your AgentRadius is at a good radius (try 0.5?).

i dont have any experience with these, how would i use them?

changing this does nothing but make it struggle around walls, and yes i tried it

the only issues i can think of is:

1). AgentRadius is too large.

2). boards are too thin or have CanCollide off.

3). AgentHeight (even though irrelevant to this in most cases… can still make NPCs not walk through narrow spaces sometimes)

4). or the NPCs HipHeight value is too small or too large… preventing the NPC from taking that small step up the board… although it looks fine in the image from what i can see atleast.

5). even though the navmesh is fine, the angle at which the boards are placed could have the navmesh conflicting with the spacing of the waypoints… this could be the most likely case, but im still not sure without seeing some debugging information.

if you dont wanna get hacky (like manually making NPC walk through or around certain ‘awkward’ obstacles when they get stuck) you need to make sure your map is on par with the spacing of your waypoints.

radius has been messed with, does nothing
boards have an invisible hitbox just to counter that issue (does nothing)
as said, irrelevant
hipheights normal

and i can give any debug info u need if its accessable

yeah agent radius probably isn’t ideal to change anyway, like you said… you’ll have issues walking around certain things depending on how you make your map…

have you tried moving the boards around too see if the waypoints could snap onto them better? (while considering the ‘spacing’ of the waypoints)

currently it looks like each waypoint is around 2-4 studs apart?

no amount of moving the boards seemed to help, and the studs are just the default with pathfinding service if thats even an option to change

default spacing is 4, you can probably try 2.

PathfindingService | Documentation - Roblox Creator Hub

you’ll see a WaypointSpacing option in the AgentParameters table used with the CreatePath function.

you can also manually add waypoints into the waypoints array.

just know this will create double the amount of waypoints of course, but the path will be a higher resolution. (which may allow the NPC too walk over narrow bridges like this)

image_2025-03-08_210621415
same thing but with more waypoints
(this is the same npc, he just got redesigned)

yeah the angle of the boards and the spacing of the waypoints isn’t the problem then…

my last resort is too ask if AgentCanJump is enabled?

if that isn’t the issue here, then you’ll have too take KingBobs advice and try a Pathfinder Link / modifier.

PathfindingLink | Documentation - Roblox Creator Hub

PathfindingModifier | Documentation - Roblox Creator Hub

agent jump is indeed enabled, i guess ima have to learn how the curse of pathfinding instances works

1 Like

the NPC could be trying too jump the gap… but i wouldn’t know how you could prevent this while keeping AgentCanJump enabled sadly…

good luck though and the links/modifiers are easier than you think.

that isnt the issue as the npc would be jumping in place due to my system, but thanks for the help, ill mess with the pathfinding links

1 Like

yeah that’s a fair point and no problem, pathfinding can be annoying sometimes lol.

well turns out this solution didnt work at all, it just does the same thing


no matter what, he doesnt pathfind.

everthing has modifiers at this rate

Agree it would be too obvious. My two other options I can think of now are:

  • The planks seem a little bit above the ground. What happens if you make them clip through? Does the NPC find the way?

  • Try learning how to use pathfinding modifiers. Create an invisible and collision-free part where the NPC wants to cross with a pathfinding modifier with math.huge as a cost. Does the NPC find a new, valid way? I do mention this again since this case of use wasn’t mentioned.

Thanks for answering those questions.

nothing happens if i sink the planks

and nothing happens with that either