Filed of vision AI?

Quick question, I can’t figure this out. I assume I should use a ray, but I really cant figure out how to do it.

Alright, I’m making a game using the Unity Bootcamp Demo (for personal use and to figure out how unity works)
I’ve read unity essentials but thats about it.

So how do I make the enemy (just a copy of my character without the character controller) Play a crouch animation and Shoot when I’m within 170 degrees of his sight, and 100 vertically? I’ve already made the script for him to walk around and patrol the area. But how do I make the AI?

Thanks

Make a mesh of his FOV. Then make it a trigger. Check player is in trigger, then do appropriate action.

awesome thanks, but how would I make him shoot at the target? Animation.play only plays crouch, obviously. How do I fire at the player? this is using the bootcamp demo for an example project.

Thanks