UI text visual glitching

Hi guys,

So I’ve spent all day attempting to set up a series of text string which would fade in and out on the screen inside an IEnumerator, I eventually gave up on the fading in and out for now, as for some reason it wouldn’t fade completely, despite other text elements in the HUD fading out just find using the same method of the text.crossfadealpha(0.0f, 5, false).

So I eventually ended up with this simplified code:

 IEnumerator QuoteSeries()
 {
    quoteBox.enabled = true;
    
            quoteBox.text = "text goes here";
            yield return new WaitForSeconds(15);
            quoteBox.text = "text goes here";
            yield return new WaitForSeconds(15);
            quoteBox.text = "text goes here";
            yield return new WaitForSeconds(15);

I’ve removed the somewhat extensive strings of text I was using, but the basic idea is that after 15 seconds the text value is changed to the next line of text I want to display which seems solid in theory. Although in practice I get a lot of strange visual glitches. The text seems to be rapidly switching in between the current string it’s attempting to display, and the previous one. Although it does it quite quickly so I can’t be sure which strings it’s attempting to display.

Put a Debug.Log statement inside the coroutine and see if the function is firing properly.

If it is, do a build and see if the problem persists. It probably won’t. UI is glitchy in editor with unity 5.