Finding TextMesh and assigning text to it

I have a text mesh in my scene called feedback and with a tag of feedback2.

Im using a script PhotoCaptureText.cs that is not tied to any gameobject or game managers.

How can i reference that textMesh and change the text of it from photoCapturetest.cs?

In PhotoCaptureText.cs add this

private TextMesh textMesh;

void Start()
{
      GameObject go = GameObject.FindWithTag("feedback2");
       textMesh = go.GetComponent<TextMesh>();
}

public void SetText()
{
      textMesh.text = thisScriptsText;
}
1 Like

thanks