Diablo like "Click to move" issue - Character is jumping back by clicking often

Hello!

I want to implement a Diablo like “Click to Move” walking system.
I have a Player with following objects attached to it:

Character Controller
Seeker
AstarAI Script
SimpleMoveModifier Script

Iam using a Terrain and the A* Grid Graph on it.
Pathfinding works fine.

The problem is, that when I click to move very often (let’s say 2 or 3 times in a second) the Player seems to jump back to a position yet passed.
If I click more often, he seems to stuck till I stop clicking.

I tried to fix this by taking the “old” targetPosition" and calculating the difference between this and the new targetPostion.
And only recalculating the path by seeker when needed.
Now I stuck…

Perhaps someone can help me…

Here’s my script Iam using as AstarAI on my Player:

deleted

Hi

That is likely because your script assumes that the start of the path is where the player is. SInce path requests might take a few frames to complete, this is not always true.
Check out the AIPath script -> OnPathComplete method, it sort of simulates movement from the start of the path to the current position when it gets a path back to avoid thinking it needs to move back.

Thank you very much!