Last message won't leave screen.,Only one message won't delete after 2 seconds all others do.
displayMessageToUser("Well done, you can now enter the Plane & leave!"); //This message stays on screen an I have tried startMessageDelete = true; inside and outside of the if-else statement block with no luck.
 if (label == "plane")
             {
                 if (nbPetrolCansCollected < 3)
                 {
                     displayMessageToUser("Sorry you need 3 Barrels to fly the Plane!");
                 }
                 else
                 {
                     Destroy(GameObject.Find("AircraftJet"));
                     plane.SetActive(true);
                     plane.transform.position += Vector3.up * 2;
                     gameObject.SetActive(false);
                     displayMessageToUser("Well done, you can now enter the Plane & leave the Island!");
                 }
             }
         }
     }
     void displayMessageToUser(string messageToDisplay)
     {
         GameObject.Find("userMessageUI").GetComponent<Text>().text =
             messageToDisplay;
         startDeleteMessage = true;
     }
 
               
                 
                messagehelp.png 
                (18.5 kB) 
               
 
              
               Comment
              
 
               
              Your answer