Skip to content

Instantly share code, notes, and snippets.

@alexson
Last active January 13, 2022 09:54
Show Gist options
  • Save alexson/fe0041394f25d537698839bc54dba484 to your computer and use it in GitHub Desktop.
Save alexson/fe0041394f25d537698839bc54dba484 to your computer and use it in GitHub Desktop.
public void CheckOverlapping()
{
Collider[] colliders = Physics.OverlapSphere(bombRoot.transform.position, detectionRadius);
foreach (Collider nearbyObject in colliders)
{
if (nearbyObject.CompareTag("Player"))
{
//Debug.Log("nearbyObject.tag: " + nearbyObject.name);
PlayerBehaviour pB = nearbyObject.GetComponentInParent<PlayerBehaviour>();
pB.bombNearby = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment