This is something I made a little while ago but didn't get around to doing anything with.
Both the player and the enemy entity use the A* path finding algorithm to move within the screen.
They both access a script that creates a grid from the obstacles in the scene (trees & fences). The player moves one grid space towards the mouse when its clicked, and the enemy moves one space towards the player.
![](https://i.ytimg.com/vi/Veyb5wl2ZD8/maxresdefault.jpg)