Just to clarify:
This is based on Distance from the Player but, ideally, should also incorporate the angle so the whole thing switches off (disable Tick, mayhap?) when the player is far away and outside of the vision cone. The vision cone is already calculated so you could leverage that.
But ofc, you may have a different idea as to when the turret’s target seeking script kicks in!