Top Down Shooter Enemy AI using raycasting

I'm new to unity and i have absolutely no experience in JavaScript and i am working on a top down shooter i have just about everything covered but i don't know how to do enemy AI at all I want to know how to make my enemies take cover from me and still try to damage the player occasionally and other types of enemies that can navigate in "hallways".

an example demo or scripts or even just help will be greatly appreciated.

The video kinda shows what i want.

The best way is to try to script by yourself, don't use ready scripts, if you need to change something, you will have problems.

Start to think about actions that your enemies will do, write everything in a paper.

Use a variable like Action : String

create a script like this:

if (action == "hide"){
     //run to a nearest determined point
     //atack your player

Try to not do "deep AI" at first time, you need to evolute your logic programing.

And, try to not post things like “how to make this game” or “i need a script that…”. Try your self and you have a specific question, everyone will be happy to help you.

Good look.