- Home /
Question by
nagarjunachada · Jul 15, 2018 at 07:12 PM ·
2dtextdynamicdynamically
Unity 2d Dynamic UI text not rendering on Canvas
Hi
I am trying to add a dynamic text to canvas but it is not appearing on screen. please help. below is my code.
var text = this.gameObject.GetComponentInChildren ();
text.text = "abc";
Text t = gameObject.AddComponent<Text>();
t.text = "Testing";
t.rectTransform.position = new Vector2 (23, 23);//screenspace coordinates
Comment