If I understand you correct the issue is you have a script lets say like
public class CollisionHandler : MonoBehaviour
{
public bool CanMove;
void OnTriggerEnter(Collider other)
{
CanMove = false;
}
void OnTriggerExit(Collider other)
{
CanMove = true;
}
}
and you want to set it to false only to one of the objects, right?
Maybe a bit hacky but you could do
public static List<GameObject> lastReset;
void OnTriggerEnter(Collider other)
{
//get your own index in list
var myIndex = lastReset.IndexOf(gameObject);
//get others index
var otherIndex = lastReset.IndexOf(other.gameObject);
// Only go on if other is exactly the object in front of you
if(otherIndex != myIndex - 1) return;
// You way to define if can move
CanMove = ...;
}
Than wherever you do your resetting also do
CollisionHandler.lastReset.Remove(objectYouReset);
CollisionHandler.lastReset.Add(objectYouReset);
To remove it and set it to the end of the list.
[Solved]to the title. The question will already visibly marked as solved once an answer is marked as accepted.