Physics.CheckSphere

static function CheckSphere (position : Vector3, radius : float, layerMask : int = kDefaultRaycastLayers) : boolean

Description

Returns true if there are any colliders overlapping the sphere defined by position and radius in world coordinates.

JavaScript
    var sphereRadius: float;

function WarningNoise() {
// Play a noise if an object is nearby.
if (Physics.CheckSphere(transform.position, sphereRadius)) {
audio.Play();
}
}