For 2d game question

Hi! I just recently installed the A* pathfinding project and I have two questions on how to do something
How do you make it so the enemy will follow a path that leads to the target that is under it? What ends up happening is that the enemy will be walking back and forth sometimes above the player. Is there a way to fix this or could it be because the nodes aren’t setup right?

If the target move, then the path has to be recalculated regularly.

Take a look at example 1 and the “AstarPathfindingProject\Core\AI\AIPath.cs” script.

Quote from the script comments :
“This script will try to follow a target transform, in regular intervals, the path to that target will be recalculated.”

Other quote about the “repathRate” variable :
“The variable determines how often it will search for new paths.
If you have fast moving targets or AIs, you might want to set it to a lower value.
The value is in seconds between path requests.”

Well when I was running it I just made the player stand right under the enemy so it wasn’t moving. But the object will still have the same affect where it would move back and forth trying to find the right path.

Actually I think what my question should be is “How can I get the Ai to fall down off a ledge?”