Why doesn't it work when I move the character with 8 directions (keyboard)?
when the character moves with the mouse with pathfinding, it's ok, but not when I move him with 8 direction (keyboard)
What are you trying to achieve ? The action is 'scroll towards the object that is pathfinding' so that is what you want ?
Develop games in your browser. Powerful, performant & highly capable.
And although the camera follows the player if he moves, if he doesn't it doesn't matter.