#PathFinding AI

1 messages · Page 1 of 1 (latest)

sharp relic
#

Recently got into making games for fun and found a pathfinding script which i tweaked so it would work with my model and features, the script works and does what it needs to do BUT the chasing is off, it does not follow the player directly or straight but when the NPC clicks on a player and Chases, it just runs by the last position and doesnt follow player, kinda like a car drift, i thought it was the meshes in the ground but i tested it on a blank baseplate and it still drifts, even when it goes towards a loopoint, it goes over and drifts, i would like it to be like those MIMIC ai's. Any help fixing is greatly appreciated, below is the script:

#

here is a clip of what it does, added night vision so you can see and flickering is intentional

grizzled sage
#

Humanoid.MoveToFinished:wait()

keen leaf
keen leaf
# sharp relic Recently got into making games for fun and found a pathfinding script which i tw...

for starters you're using path.reached:wait() which is a newb trap, the problem you're facing is one of the reasons why it traps newbs. secondly, pathfindingservice yields when it creates a new path so it's always going to be delayed, so that's the second reason why you've been newb trapped. and thirdly, you do not need to pathfind if the npc has direct line of sight. this would be trivial to add in if you weren't doing path.reached:wait() with all the same problems as doing humanoid.movetofinished:wait().