Collision Detection with object already in detection area

Okay so I extended the AOE of my block. When it has a intruder in it, my block begins rotating and firing. The thing is, if there is already another block inside it, and i turn my variables off for making the block fire, the block already inside the AOE is not shot at. It is not my variables. It’s detection. I have a OnTriggerEnter() function as so
function OnTriggerEnter(enemy : Collider){

	if(s == false){
		target = enemy.gameObject;
		s = true;



I have figured that when my block gets detected, it gets stopped from being detected because it has to enter it right when it needs to.

I have thought up two solutions.

Making a table and a run-through of objects to be shot at
Leave as is and move the position of my blocks

What would the best solutions to my problem, how to detect objects already in detection area, when the objects cannot be detected inside the AOE?


If you are okay with your area of effect being a sphere, you can use Physics.OverlapSphere(). OverlapSphere() returns a list of colliders within the area. You could then attack them in order or you could pick one at random.