Hi, I want to make a script that makes the words “3 2 1 Go!” appear on the screen of the game when I press the play button on Unity. My game so far just starts right off the bat like any normal beta game in Unity. After you press the play button I want the screen to show my game, and then show the 3 2 1 numbers in order one at a time, and then say go! I already started making a script, it doesn’t work so far because it has errors but it’s an early script. All I want is someone to help me fix my script, you can even add things if I missed something. Please help and thank you so much in advance! Oh and I know it’s not the right place to post this, but please understand I’ve been posting too much in the scripting threads already.
public class Go : MonoBehaviour {
private float initialtime;
private int restSeconds;
int CountSeconds;
int CountMinutes;
private int seconds;
private int minutes;
private string texttime;
void Awake (){
initialtime = Time.time;
CountSeconds = CountSeconds + (CountMinutes + 60);
}
void OnGUI (){
guitime = Time.time = initialtime;
restSeconds = CountSeconds = guitime;
seconds = restSeconds % 60;
minutes = restSeconds / 60;
texttime = String.format("(00:0):(00:1)", minutes, seconds);
GetComponent<GUIText>().text = texttime;
if(seconds <= 0 && minutes <= 0)
{
//Pause the game
Time.timeScale = 0;
}
}
}