C# AI move on Sight
im trying to put my AI to move and attack the player when the player enter its field of view but i cant i just dont know what code to use im very new to unity and my code is a little weak so can someone help me
I think you'll need to be more specific. Do you want the AI to see through walls? Does it have a set distance it can see to? How much of a Field of View angle should the AI be able to see?
Not only that, but what is your method for AI movement; do you want it to follow a Navigation $$anonymous$$esh, or just fly through the air on the quickest route? How does an enemy attack a player, with ranged projectiles or melee?
I might not be able to help with all of these situations, but the extra info could help other people help you! And while you're at it, do some Googling for similar questions and answers.
Answer by MaverickFF · Nov 02, 2016 at 11:51 AM
the enemy is a melee and he cant see through walls i made a box collider 2D from his back to his front and i whant when ever the player wallks in to that box collider that is coming out of him the enemy starts moving to him this game is like a dungeon kind of game with a big maze and all that stuff
Your answer
![](https://koobas.hobune.stream/wayback/20220612095758im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Move a object along a vector 1 Answer
Spawned enemy walk from right to left destroying turrets. 0 Answers
Movement input problem? 1 Answer
2D Object following the cursor without glitchyness at the center 0 Answers
Game Object jumps to z-axis 0 Answers