make spherecast collider only detect certain types of objects?

I’m making a prototype for a very primitive AI system, I call the Physics.OverlapSphere function using the center as the Vector3 coordinates of the player controller as the center of the spherecast collider, I have a grid of cubes as enemy “spawnpoints” and I’m trying to see if the first person controller is near any of the potential enemy spawnpoints. How do I make it NOT detect the terrain and the First Person Controller itself. here is part of my code

var inRange = new Array();

function getInRange(center : Vector3, rad : float){

inRange = Physics.OverlapSphere(center, rad);
if(inRange.length > 0) {
for(var i : int = 0; i < inRange.length; i++){
	if((inRange_.GetType.Equals(TerrainCollider)) || (inRange*.GetType.Equals(CharacterController))){*_

* inRange.RemoveAt(i);*
* } else {*
_ Debug.Log("hit " + inRange*);
} else {}}*
as you can see I’m trying to remove the “Terrain” and “First Person Controller” detections from the array but it won’t work. Why?_

Use layer-based collision detection. Unity - Manual: Layer-based collision detection