Print event only happening once?

Hello, I have been working with a tutorial, and the concept is very simple, every time the Turret finds me it prints: Gamer detected. If I get too far away it prints: Out of Range!, and if I'm hiding behind an object it prints: Object in the way.

The thing is that this is not working all the time, it only prints once. If I come back after being out of range, the console won't print that I'm back. I have spent hours trying to figure out why! Plus there are no errors in the log.

`var target : Transform; var range = 10.0;

function Awake() { if(!target) { target = GameObject.FindWithTag("Gamer").transform; } }

function Update () { if(target && CanAttackTarget()) { //transform.LookAt(target); var targetRotation = Quaternion.LookRotation(target.position - transform.position, Vector3.up); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 1.2); }

}

function CanAttackTarget() { //Check if the target is close enough if(Vector3.Distance(transform.position, target.position) > range) { print("out of range"); return false; }

    var hit : RaycastHit;

    //Check if there's collition invetween turret and target

    if(Physics.Linecast(transform.position, target.position, hit))
    {
        if(hit.collider.gameObject.tag != "Gamer")
        {
            print("Item in the way: "+hit.collider.gameObject.name);
        }
        else
        {
            print("Gamer detected!");
            return true;
            }
    }

    return true;

} `

Make sure you haven't marked "Collapse" in the Console Window. If you have, then multiple similar logs won't show.

Make sure the Collapse button in the console is unselected, that strips out duplicate messages