I have an NPC that follows the player around. I want it to keep track and update 'Cover Positions' if things get bad.

I am walking through a village all of the buildings have mesh colliers on them. I want my NPC to create an array of all the different buildings within a 10 by 10 unit box around the NPC to flee to.

I tried using indie{RAIN} but felt restricted by it so I decided to create my own sensor. I started with a trigger box collider and simple script to detect collisions:

void OnCollissionEnter(Collision other){
		if(other.transform.tag == "building"){
			Debug.Log (other.gameObject.name);	
		}
	}

this however does not detect collisions. I was wondering if anyone had tried to do something like this and how they achieved it( ideas not actual working game object or code). I want to figure this out on my own I just want an idea of where to go. Also please no RAIN stuff, already tried didn’t like.

thanks again

Use OnTriggerEnter instead. Make sure to mark the trigger box on the collider.