The problem might be how the game sees if a part of the game is empty or not. ROBLOX's Pathfinding finds a path from point a to point b without any walls/holes. So when a space is 16% filled the game decides to say "There is a hole here!". This is because of the EmptyCutoff. It is set to 0.16 which is 16%. So if 16% or less of the 4x4x4 area is not filled, it is considered empty.
To resolve this problem there is 2 solutions:
#Resize the sand/base
There is a chance the sand/baseplate is too short and Pathfinding doesn't do well with small, thin parts. Resize it on the y axis, that might fix it! If not... Do next solution:
#Change the EmptyCutoff
Change the empty cutoff to a number 0-1. If it's 0, then it will always be full, if it is 1, it will always be empty. Change this number to a reasonable number like 8% would mean you would have to fill more than 8 studs in a 4x4x4 area to be considered filled. Make sure it won't be too low or it might end up walking somewhere it shouldn't.
local pathfind = game:GetService("PathfindingService")
pathfind.EmptyCutoff = 0.8
Hope it helps!
3 comments
For using an AI use ComputeSmoothPathAsync instead
There are going to be alot of NPC's, and they have very simple Ai, so raw path is better for performance purposes.
Okay, Hmm I'll do more research and I'll give you the answer soon.