1. Home
  2. Docs
  3. 3D Text Effects – Quick How-Tos
  4. How To – Assign text from script

How To – Assign text from script

1. Create a new monobehviour:

public class AssignText : MonoBehaviour {

    public DynamicTextElement Element;

	// Use this for initialization
	void Start () {
        Element.Text = "New Text";
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}

as you can see , the text can be changed by setting Element.Text

2. Create a new game object and add the AssignText component. Drag the text element into the object: