make object (child) look at another object after entering trigger

Soi have a empty box (set as trigger) and inside it i have a turret.
he idea is when a player enters the trigger it finds that player and gets the turret to look at it until its out or range, Is their a tutorial somewhere on how to do this?

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Transform player, turret;
    void Update() {
        Vector3 relativePos = player.position - turret.position;
        Quaternion newRotation = Quaternion.LookRotation(relativePos);
        turret.rotation = newRotation;
    }
}

Read This for further information