Help with GUI

I am having problems with a simple Pause Menu script I made. The Idea is that when I press the P key, the game pauses and shows a menu. There should also be a button in the corner of the screen to pause the game. Currently the game pauses (Physics timescale goes to Zero) but none of the buttons appear. The script is a component of the Main Camera on a first person Character controller GameObject. Could Somebody please tell me what I am doing wrong, and give some suggestions?

The code is below:

import UnityEngine

class PauseMenuHandler (MonoBehaviour): 
	private isPaused as bool = false

	def FixedUpdate ():
		if Input.GetKeyDown(KeyCode.P):
			IsPaused = true
			Time.timeScale = 0
			
	def OnGUI():
		if isPaused:
			if GUI.Button(Rect(Screen.width/2-100, 50, 200, 50), "Resume game"):
				isPaused = false
				Time.timeScale = 1
			if GUI.Button(Rect(Screen.width/2-100, 150, 200, 50), "Quit"):
				Application.Quit()
				if Application.isEditor or Application.isWebPlayer:
					Debug.Log("Failed to quit due to being run in editor/webplayer!")
		
			if GUI.Button(Rect(10,10,50,20), "||"):
				isPaused = true
				Time.timeScale = 0

Hmmm, is this the Booscript that I’ve heard Unity also supports? It looks odd.

Do you have a GUILayer component on your Camera?

IsPaused != isPaused

Yep he’s right. You’re using two different bools with similar names. That’s what is likely causing the problem. I didn’t notice.

Thanks hpjohn and Glader, that’s the kind of thing I fail to pick up on when coding, I’m just a student, so I’m no master coder, and it helps when people in the community point out stuff like this.

Thanks!