Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Pause Menu Issue (Black Screen)

$
0
0
Hi guys, I've been having an ongoing issue with trying to get any pause screen/menu to work in my game. I have tried out various tutorials with different UI methods and scripts but to no avail. The main issue I have with the script I'm using at the moment is that when I hit play the screen is black, but I can hear all of the audio and AI working, I just can't seen anything. When I disable the script, it works as normal. I've tried disabling the Canvas object and switching from GUI text to UI text as well as trying to use textures instead. but still no solution. I know it's probably something really obvious, but i'm rather confused. Here is the script I am using either way... #pragma strict private var pauseGame : boolean = false; private var showGUI : boolean = false; function Update() { if(Input.GetKeyDown("p")) { pauseGame = !pauseGame; if(pauseGame == true) { Time.timeScale = 0; pauseGame = false; showGUI = true; } } if(pauseGame == false) { Time.timeScale = 0; pauseGame = true; showGUI = false; } if(showGUI == true) { gameObject.Find("Pause").GetComponent(Canvas).enabled = true; } else { gameObject.Find("Pause").GetComponent(Canvas).enabled = false; } }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>