Changing textmesh in another object (C#)

I have two objects, one with a mesh, collider, all of that; and an empty object right above the first one that’s supposed to do nothing but show text. In the script for the first object, I want to change the textmesh of the second, but it doesn’t seem to work. This is what I’ve got so far:

    public class NPCBehavior : MonoBehaviour {
    public TextWriter textWriter;
    public Transform target;

    Start () {
	textWriter = GetComponent<TextWriter> ();
}

void Update () {
	//Creating text
	if (Vector3.Distance (this.transform.position, target.position) < 1.8f) {
		textWriter.textMesh.text = "Hey!";
	}
}

I dragged the empty object with the textwriter script onto the public textwriter slot in the first object’s inspector.
The textwriter script is practically empty, it just holds a public textmesh which I drag from the standard textmesh component.
Also, the error in question is “Object reference not set to an instance of an object.”

Getting a component from another game object is a two step process, identify the object then get the component. So you need to use the name or tag of the object to find it before you can do a GetComponent():

 textWriter = GameObject.Find("ObjectWithTextWriter").GetComponent<TextWriter> ();

http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

http://unitygems.com/script-interaction1/

Note that the UnityGems website seems to be down.