Why does npc animation reset when using pathfinding?

i have a system where the npc walks to players without pathfinding but when the npc is in a part then it will use pathfinding. the problem is the the npc keeps jumping when it is in the part
ai testing anim.rbxl (1.9 MB)
also, the main script is in server script service and the simplepath module is in serverstorage


but this is what happens when you disable jump:

In your SimplePath module, change this line COMPARISON_CHECKS = 1; to COMPARISON_CHECKS = 10; in the DEFAULT_SETTINGS table.

For some reason that value was so low that it was checking if the NPC was stuck every frame (it checks by comparing its distance between its last position and its current position.

1 Like

idk why but it doesn’t work for me it still looks the same

Worked for me when I did it in my place with your file. Must be doing something wrong.

1 Like

can you share file plz because it not work for me

ai testing anim.rbxl (1.9 MB)

I also edited your original code slightly, I added a check to see if the path actually needs to be stopped instead of spamming :Stop() unnecessarily.

yes thx when you try it out when the npc does not have animation the it looks normal but when you add a walking animation:

Odd, maybe something is wrong with the animation script? I’m not sure if that was in the file I didn’t get a chance to check.

it is in the npc but ok i might just check it out

Nah, its not the animate script

lets goo i fixed it by using noobpath module!

idk why npc the npc goes through wall but i can fix that

1 Like