Hello, I am trying to implement A* pathfinding into my 2d top down game. I decided to use the A* pathfinding project by Aron Granberg. I already set up the pathfinding using the documentation, but I’ve ran into a problem when I tried adding movement. The AI moves towards the target, but it does so in a jerky/stuttering motion. I searched the forums of Aron and I’ve found what the problem and even the solution is, but it is too complicated for my understanding of programming . Here is the problem (the solution is in the comments): 2D Weird movement - #2 by BJ_Moreton - Support Forum . I hope that someone with experience with this project could help me solve this problem. I’ve tried implementing the code that Aron referenced from OnPathComplete method, but there is too many variables and methods that I just dont understand what they mean/do. Thanks for the help.
An easy solution should be getting your path and not regenerating it every frame. Without seeing your code or issue I can only assume the character calculates the path, moves, recalculates and stops during this point then repeat. If you introduce a stopping delay this should smoothen this issue out.
Maybe make it so that if your not at the end of the path and your recalculating, carry on moving to last known point, until the new path is ready.