Hello,
I am making a 2D platformer type of game and I have Spacebar and left-mouse button as my jump keys.
So basically when I click on my pause button, it does the pause the game, however, it also triggers a jump and basically, the players hang around in the middle of the jump.
How can I make a click on the pause button to not register as a jump command?
public class PauseMenu : MonoBehaviour {
public string mainMenuLevel;
public GameObject pauseMenu;
public void ResumeGame() {
Time.timeScale = 1f;
pauseMenu.SetActive (false);
}
public void PauseGame() {
Time.timeScale = 0f;
pauseMenu.SetActive (true);
}
public void RestartGame () {
Time.timeScale = 1f;
pauseMenu.SetActive (false);
FindObjectOfType<GameManager> ().Reset ();
}
public void QuitToMain(){
Time.timeScale = 1f;
SceneManager.LoadScene (mainMenuLevel);
}
}