Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity overlapspherenonalloc

int maxColliders = 10; // detected objects limit
Collider[] hitColliders = new Collider[maxColliders];
int numColliders = Physics.OverlapSphereNonAlloc(center, radius, hitColliders);

for (int i = 0; i < numColliders; i++)
{
  hitColliders[i].DoSomething();
}
 
PREVIOUS NEXT
Tagged: #unity #overlapspherenonalloc
ADD COMMENT
Topic
Name
3+2 =