Hello,
In the game, pressing “p” activates Paused, which sets time.timeScale to 0 (pauses the game) and it also should draw a GUI textures but that’s the problem, it doesn’t work.
Here is the error that is given
Here’s our code:
#pragma strict
private var pauseGame : boolean = false;
var aTexture : Texture;
function Pause () {
{
Time.timeScale = 0;
pauseGame = true;
}
}
function Start (){
Time.timeScale = 1;
}
function Update () {
if (Input.GetKeyDown("p"))
{
pauseGame = !pauseGame;
}
if (pauseGame == true){
Pause();
GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height), aTexture, ScaleMode.ScaleToFit, true, 10.0f);
}
if (pauseGame == false)
{
pauseGame = false;
}
}
