sigh I been working for 5 days straight on this super smart AI and I can't figure out why it doesn't work. I looked over line of line of code and I found ONE error holding me BACK. The Path Finding Service keeps returning nil with ALL my positions. For example, I have a function which looks like so:
local function PathFinder(V31, V32)
local Path = game:GetService("PathfindingService"):CreatePath():ComputeAsync(V31, V32)
print(Path)
if Path then
return Path:GetWaypoints()
else
return {V32}
end
end
Every time i put the two vectors into the function the script responds with nil. For example I would have a part at the coordinates 0, 0, 0 and I would use Pathfinder to get to 10, 0, 10 and this would be its response:
nil
And sometimes it would error (when I ran it in command bar):
local path = game:GetService("PathfindingService"):CreatePath() local BHRP = workspace["Smart AI"].HumanoidRootPart.Position local Part = workspace.Part.Position path = path:ComputeAsync(Vector3.new(BHRP.X, 0, BHRP.Y), Vector3.new(Part.X, 0, Part.Z)) pa:2: attempt to index nil with 'GetWaypoints'
If you could assist me in any way possible I would be extremely grateful.
