I have this line of code
void Update () { float alVal = 0.0f; float damping = 1f; alVal += damping * Time.time; GameObject text2 = new GameObject(); text2.AddComponent (typeof(GUIText)); text2.guiText.color = new Color (1f,1f,1f); text2.guiText.name = "name"; text2.guiText.text = "YOLOMF"; text2.guiText.pixelOffset = new Vector2 (100, 100); text2.guiText.color = new Color(1f,1f,1f,alVal); Debug.Log (alVal); } I want to create a SINGLE TEXT, but I guess the Update() function keeps on making more.
I need that SINGLE TEXT to do an animation of Fade-In that's why it is in Update()
GUITextoutside ofUpdatethen, so it only gets created once, then animate it insideUpdate? Or set and check a flag to make sure it happens only once? This sounds like it's more about programming and not really about game development. \$\endgroup\$GUITextin C and do a fade-in/fade-out? I think that would help a lot and might also solve my current problem. Thank you sir @Anko. \$\endgroup\$