Activating only one of many prefabs with the same tag

My game will be using signs to use tell the player different objectives they will have to accomplish it. These signs will hold hidden messages which only appear when the player is facing directly at them. In order to accomplish this, the player character will project a ray onto the sign’s collider. When it does hit the sign, the message appears. I have that part of the sign’s functionality set up; my trouble comes with making sure the sign the player is looking at is the only sign that shows its hidden message.

If my ray hits one of the colliders on the sign, all of the signs activate, not just the one the ray hits. I’m not quite sure what to do at this point. I’ve looked all over for help with this issue, but none of them help with keeping one out of a number of prefabs active. Here is the class that activates the signs when the player looks at a sign:

public class SignContentFinder : MonoBehaviour {

    GameObject[] interactSigns;

    void Awake() {
        interactSigns = GameObject.FindGameObjectsWithTag("SignContent");
    }
	
	// Update is called once per frame
    void Update()
    {
        Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
        RaycastHit hit;
        foreach (GameObject sign in interactSigns)
        {
            if (Physics.Raycast(ray, out hit, 5f))
            {
                sign.renderer.material.mainTexture = sign.GetComponent<SignContentController>().secretTex;
            }
            else
                sign.renderer.material.mainTexture = sign.GetComponent<SignContentController>().mainTex;
        }
    }
}

Any help would be appreciated. I would like to actually get some feedback this time, as opposed to the 5-6 recent questions I’ve posted with no feedback.

It is because of your forloop. You should be checking the hit variable to see if that is actually the sign youre hitting. I would do something like this(not tested >_<):

 void Update()
    {
        foreach (GameObject sign in interactSigns)
        {
             //set all our signs to not show our secret text
             sign.renderer.material.mainTexture = sign.GetComponent<SignContentController>().mainTex;
 
        }
        Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
        RaycastHit hit;
        if (Physics.Raycast(ray, out hit, 5f))
            {
                  SignContentController controller = hit.collider.gameObject.GetComponent<SignContentController>();
                  if(controller != null)//if we are null it isnt a sign >_<
                  {
                       controller.gameObject.renderer.material.mainTexture = controller.secretTex;
                  }
            }
    }