Skip to main content
deleted 7 characters in body
Source Link

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop

Edit:

First make sure that Physics2D.OverlapCircleAll is not returning the same collider more than once. I'm not at home right now to test your code, but by looking at it, it seems that an infinite recursion would happen right here:

TriggerBombAbility(cubeA);

//nerabyColliders returns cubeB
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerSpecialCubeAbilityTriggerBombAbility(cubeB);

//nerabyColliders returns cubeA
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerBombAbility(cubeA);

//and this repeats forever....

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop

Edit:

First make sure that Physics2D.OverlapCircleAll is not returning the same collider more than once. I'm not at home right now to test your code, but by looking at it, it seems that an infinite recursion would happen right here:

TriggerBombAbility(cubeA);

//nerabyColliders returns cubeB
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerSpecialCubeAbility(cubeB);

//nerabyColliders returns cubeA
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerBombAbility(cubeA);

//and this repeats forever....

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop

Edit:

First make sure that Physics2D.OverlapCircleAll is not returning the same collider more than once. I'm not at home right now to test your code, but by looking at it, it seems that an infinite recursion would happen right here:

TriggerBombAbility(cubeA);

//nerabyColliders returns cubeB
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerBombAbility(cubeB);

//nerabyColliders returns cubeA
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerBombAbility(cubeA);

//and this repeats forever....
added 699 characters in body
Source Link

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop

Edit:

First make sure that Physics2D.OverlapCircleAll is not returning the same collider more than once. I'm not at home right now to test your code, but by looking at it, it seems that an infinite recursion would happen right here:

TriggerBombAbility(cubeA);

//nerabyColliders returns cubeB
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerSpecialCubeAbility(cubeB);

//nerabyColliders returns cubeA
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerBombAbility(cubeA);

//and this repeats forever....

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop

Edit:

First make sure that Physics2D.OverlapCircleAll is not returning the same collider more than once. I'm not at home right now to test your code, but by looking at it, it seems that an infinite recursion would happen right here:

TriggerBombAbility(cubeA);

//nerabyColliders returns cubeB
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerSpecialCubeAbility(cubeB);

//nerabyColliders returns cubeA
var nearbyColliders = Physics2D.OverlapCircleAll(specialCube.transform.position, explosionRadius);

TriggerBombAbility(cubeA);

//and this repeats forever....
Source Link

When this kind of error happens, its likely there is a infinite recursion loop in your code.

You need to make sure there that Physics2D.OverlapCircleAll is not returning the same collider more than once.

If that is not the problem, you can try to to replace the recursive function with a while loop