A* Pathfinding Project

I want to make character move immediately


#1

Hello.
I want to make character move immediately.
but there is delay before starting moving.
how can i remove delay?
Could you show me example source code?


#2

Hi

Normally the AI recalculates it’s path regularly (controlled by the repath rate field).
If you want to force it to recalculate its path immediately after you have set the destination you can call ai.SearchPath(). Note that the path calculation is still asynchronous so don’t call it too often or you will end up cancelling the previous path calculation. You could check ai.pathPending to make sure that no other path calculation is being done at the same time if you want to call SearchPath more often.