Is your debug.log coming out as “it worked”? If it isn’t you could handle the code like this. I’m not sure if this is the type of answer you were looking for but here you go.
using UnityEngine;
using System.Collections;
public class ColorDetector : MonoBehaviour
{
public GameObject Key;
private int colorCounter = 0;
void Update() {
if (colorCounter = 4) {
//setactive blah
}
}
void OnTriggerEnter (Collider Keyz)
{
if (your thing is green) {
colorCounter++;
}
if (your thing is red) {
colorCounter++;
}
// repeat for your colors
}
void OnTriggerExit (Collider Keyz)
{
if (your thing is green) {
colorCounter--;
}
if (your thing is red) {
colorCounter--;
}
//repeat for colors
}