NPC Roaming Paths
Posted: Fri Feb 09, 2018 8:01 pm
Does anyone have a fix for the NPC pathfind?
Before, mine would stop at the last node in the list and not move anymore.
I currently have a small fix for it but just curious if anyone had a permanent fix for it.
if anyone wants my temp fix, here is what i have done
function onPath(npc)
--Make sure you first path location is your last path location--
--Otherwise it will disappear and reappear at the first location--
if (npc:isFollowingPath() == false) then
npc:pathThrough(pathfind.first(path));
npc:setPos(pathfind.first(path));
end
pathfind.patrol(npc, path);
end;
Before, mine would stop at the last node in the list and not move anymore.
I currently have a small fix for it but just curious if anyone had a permanent fix for it.
if anyone wants my temp fix, here is what i have done
function onPath(npc)
--Make sure you first path location is your last path location--
--Otherwise it will disappear and reappear at the first location--
if (npc:isFollowingPath() == false) then
npc:pathThrough(pathfind.first(path));
npc:setPos(pathfind.first(path));
end
pathfind.patrol(npc, path);
end;