- Home /
 
 
               Question by 
               importguru88 · Aug 31, 2016 at 08:54 PM · 
                scripting problemtexttextmesh  
              
 
              I can't get Text Mesh to disappear in the scene / How do I make the Text Mesh disappear in my scene
I only can get the Text Mesh to appear in the scene . The thing is I want the text to appear in scene five seconds later and disappear eight seconds later . I don't have any errors . I don't know why it's not working here is my script :
  using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;
    
    public class oik : MonoBehaviour {
    
     private Text text;
  
       public float timeShown;
    
    
         void ShowMessage(string message, float timeToShow = 10)
     {
         StartCoroutine(ShowMessageCoroutine(message, timeToShow));
     }
        
         IEnumerator ShowMessageCoroutine(string message, float timeToShow = 10)
     {
  
         while (timeShown < timeToShow)
         {
             timeShown += Time.deltaTime;
             yield return null;
         }
  
         text.text = " The Reqiure Score is 1700" ;
     }
    }
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Can't drag text from hierarchy with TextMeshPro 0 Answers
Adding vertices to TextMesh Pro 0 Answers
How would I script text to pop up? 1 Answer
Why if I execute .SetText on the Start it dont works. 1 Answer
TextMeshProUGUI Font Disappearing on Low FPS,Unity TextMeshProUGUI Font Disappearing 0 Answers