I have a problem, where my Physics.OverlapSphere is detecting itself, this is a problem, when trying to detect the nearest object, because that will always be itself.
var Closest : Transform;
var hitColliders = Physics.OverlapSphere(transform.position, ViewDistance);
var i = 0;
while (i < hitColliders.Length) {
if (hitColliders*.gameObject != this.gameObject) { //Why isn't this line preventing it?*
Closest = hitColliders*.transform;*
}
}