Hello, I’m a fairly beginner coder and id like to make a very simple ai script. Lets imagine the ai is a turret(well it is) now with unity we add somekinda fov bubble around it so it could see. Now what i want to do is when a player enters that fov bubble the turret will shoot and rotate to keep shooting the player until its out of its fov bubble or rotate depending on the turrets position to shoot the player as in the first example. I dont want the turret to be rotating when the enemy isnt near no patrolling. i just want the turret to know when the player enters the fov area and then the turret will rotate or shoot as in the previous 2 examples.
Any help?