I’m a little confused as how the coin spawning works. My coin has a Circle Collider 2D and my coin spawner has the following code:
int numColliders = Physics2D.OverlapCircleNonAlloc(spawnPoint, coinRadius, coinBuffer, layerMask);
if(numColliders == 0)
{
return spawnPoint;
}
What is this saying…is it saying "If the coin collider doesn’t touch an object on “Layer X”, then it is a valid spawn location? If so, does that mean that all of my walls/rocks/etc where I don’t want the coins to spawn should be on “Layer X”?