I’m trying to change my boolean to true if the player finds himself within a certain distance of any object tagged as “tree”, ive searched for an answer everywhere but im still unsure as to what is causing the problem in my script. I don’t get any errors however the boolean does not change regardless of the players distance with the tagged objects (which are definitely tagged). Can someone help me out please?

var player : GameObject;
var tree : GameObject[];
var NearTree : boolean = false;
function Awake () {
tree = GameObject.FindGameObjectsWithTag("tree");
}
function Update () {
var distance = Vector3.Distance(player.transform.position, tree.transform.position);
if(distance > 5){
NearTree = false;
}
if(distance < 5){
NearTree = true;
}
}

#pragma strict
var player : GameObject; //Player GameObject
var tree : GameObject[]; //Tree Array
var dist : float[]; //Distane Array
var NearTree : boolean[]; //Boolean Array
function Awake () {
tree = GameObject.FindGameObjectsWithTag("tree"); //Let's find all the tree
dist = new float[tree.length]; //Distance Array match with Tree Array size
NearTree = new boolean[tree.length]; //Boolean Array match with Tree Array size
}
function Update () {
for (var i = 0; i < tree.Length; i++) { //For all Tree in the tree Array
//Let's Find all distance (dist_) beetween player and all the tree (tree*)*_