Pause Game does not lauch new menu

In my PlayerBehavior.cs file

  void Update () 
	if (Input.inputString.Length>0){
	Debug.Log ("Pressed =" + Input.inputString);

	if (Input.GetKeyDown ("p"))  //from Up



PauseMenu.cs is as follows:

using UnityEngine;
using System.Collections;

public class PauseMenu : MonoBehaviour {

    public static bool isPaused;
public float windowWidth= 256;
public float windowHeight = 100;
public GUISkin newSkin;

enum Menu{None, Pause, Options};
private Menu currentMenu;

// Use this for initialization
void Start () {
	isPaused = false;
	currentMenu = Menu.None;

void OnGUI() { = newSkin;
	Debug.Log ("Inside OnGUI");
	if(isPaused && currentMenu == Menu.None)
		currentMenu = Menu.Pause;
		Debug.Log ("Inside isPaused && currentMenu == Menu.None");

	if(currentMenu == Menu.None)
		Time.timeScale = 1.0f;
		Debug.Log ("Inside currentMenu == Menu.None");

	Time.timeScale = 0.0f;
	switch (currentMenu)
	case Menu.Options:
		Debug.Log ("Inside before ShowOptionsMenu");
	case Menu.Pause:
		Debug.Log ("Inside before ShowPauseMenu");

Looks like inside OnGUI() function on PauseMenu.cs IsPause=false to cause Menu.Options never to be true from Main_Menu scene that includes PlayerBehavior.cs script. Any idea what is causing this?

You are changing a variable after changing the timeScale. The variable you are trying to change is framerate dependent, so your variable will never ever change when the ingame time has “stopped”, or in other words == 0. I cannot think of a workaround at the moment I’m affraid. But this is what’s causing your problem.