I don't think there is a way to control the thickness of a ray, however, you can use TWO rays.
Here's how it works, create 2 rays, one at the very far left of the mob, and one at the very far right.
Cast them in the direction the mob is currently moving at, then check if BOTH of the rays return nil, if one of them returns a hit, it would mean the path is too narrow to move through.
An example would be like this:
01 | local Way 1 = Ray.new(Start + Vector.RightVector*Radius, (Vector.LookVector+Vector.RightVector*Radius) * (Start-End).magnitude) |
02 | local Way 2 = Ray.new(Start + Vector.RightVector*-Radius, (Vector.LookVector+Vector.RightVector*-Radius) * (Start-End).magnitude) |
03 | local Blocked 1 = workspace:FindPartOnRayWithIgnoreList(Way 1 , Ignored, false , true ) |
04 | local Blocked 2 = workspace:FindPartOnRayWithIgnoreList(Way 2 , Ignored, false , true ) |
06 | if not (Blocked 1 or Blocked 2 ) and Start.Y - End.Y < 1.5 then |