using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Transform other;
public float closeDistance = 5.0F;
void Update() {
if (typeof(other)) {
float sqrLen = other.position - transform.position.sqrMagnitude;
if (sqrLen < closeDistance * closeDistance)
print("The other transform is close to me!");
}
}
}