I've done everything I programmed all the states and do they have to alternate the way I want, but I can't succeed in making the player do this enemy without hitting the obstacles such as walls and other enemies. I'm doing both a pathfinder that only active if the enemy does not see the player then it finds the shortest path to reach it.
I've done it follow the player just need it to find the way to the player if there are obstacles ahead.
I do not know if it is very difficult to make, but if someone can give me some tips on how to program the Pathfinder ...

Anyone?