Which point of the text shares the position of the Transform.
GetComponent(TextMesh).anchor = TextAnchor.MiddleCenter;
using UnityEngine;using System.Collections;public class example : MonoBehaviour { void Example() { GetComponent<TextMesh>().anchor = TextAnchor.MiddleCenter; }}
import UnityEngineimport System.Collectionsclass example(MonoBehaviour): def Example(): GetComponent[of TextMesh]().anchor = TextAnchor.MiddleCenter