Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

OverlapSphere Max objects returned 128

Discussion in 'Physics' started by juffowup, Dec 7, 2014.

  1. juffowup


    May 10, 2014
    In my game I'm setting off a bomb in a large swarm. Physics.OverlapSphere seems to return a maximum of 128 Colliders. That only accounts for a portion of the swarm inside the blast radius. Is there a way to remove that cap?

    I think I can work around the issue by checking to see if 128 was returned, moving those 128 to a different layer, then calling OverlapSphere again. But, I'd rather the function just gave me the correct result the first time.
  2. SpeakUpGames


    Nov 25, 2014
    Could you possibly instantiate an empty game object with a sphere collider with IsTrigger set to On? And do some manipulation in OnTriggerEnter.