Implement this OnDrawGizmosSelected if you want to draw gizmos only if the object is selected.
var explosionRadius : float = 5.0; function OnDrawGizmosSelected () { // Display the explosion radius when selected Gizmos.color = Color.white; Gizmos.DrawSphere (transform.position, explosionRadius); }