# Physics.CheckSphere never returning true despite being called to where a hitbox is

I'm trying to create a random level generator where I have a load of rooms 16x10 and I generate them when the player enters the room. I want to check the space where I want to place a room, in this case up for if there's already a room there. I've written this code to do that but it doesn't appear to be working. Currently it should ALWAYS return true (and not run the code) because the object it is on has a hitbox. I want it to hit triggers because then I don't need a physical block in the centre of every room (hard when the rooms are even both ways)

Can you see what's wrong here? The code does spawn a block in the correct place.

if (!Physics.CheckSphere(new Vector2(transform.position.x, transform.position.y), 1f, 6, QueryTriggerInteraction.Collide))
{
//Get list of open bottoms
getList("Assets/Room Lists/bottom.txt");
//Make a random number from the list
int newRoomIndex = random.Next(0, prefabObjects.Count);
//Get that object
GameObject newRoom = prefabObjects[newRoomIndex];
//Place it in the world in the correct position
Instantiate(newRoom, new Vector3(transform.position.x - 8, transform.position.y + 15, transform.position.z), Quaternion.identity);
}


It appears that Physics.CheckSphere doesn't work with 2D colliders for some reason. I ended up using Physics2D.OverlapCircles instead.
• That "some reason" is that the Physics class refers to the 3D physics system powered by PhysX (the mention of a 3D volume like a sphere is a hint). The 2D physics system in Unity, Physics2D is an entirely separate simulation universe, powered by Box2D. The two physics worlds don't know about each other's colliders. – DMGregory Jan 21 '17 at 16:17