Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by OmegaGeode · Mar 11 at 03:21 AM · tutorials

Pause Menu Buttons not clickable

I have a very similar problem to Maggatron's question in that I'm following Brackey's Tutorials and my pause menu buttons do not highlight or click - I added Debug.Log lines to each method in the PauseMenu script to watch for in the console, but only the keypress to open or close the pause menu does anything in the console. In my case, the Main Menu works perfectly, including transitioning to an options menu and back to main, but once I load the game, I can pause and unpause with the key I script it to (and can change that key and have the same behavior on any other key in case it was because of using the escape key that frees the mouse) but cannot highlight or click any of the buttons. I do have an EventSystem file just like seen in Brackey's video and mentioned on Maggatron's thread. The panel is a child of the canvas, and the buttons children of the panel. Here is the script for my main menu that works as I expect:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;

 public class MainMenu : MonoBehaviour
 {

 public void EnterGame() 
 {
     SceneManager.LoadScene(1);

 }

 public void QuitGame() 
 {
     Application.Quit();
 }

 }

And here is the script for the Pause Menu that isn't working correctly. Any advice on where to look is most welcome:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;

 public class PauseMenu : MonoBehaviour
 {
 public static bool SceneIsPaused = false;

 public GameObject pauseMenuUI;

 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown("p"))
 //            if (Input.GetKeyDown(KeyCode.Escape))
     {
         if (SceneIsPaused)
         {Resume(); }
         else {Pause(); }
     }
 }

 public void Resume()
 {
     Debug.Log("Resuming");
     pauseMenuUI.SetActive(false);
     Time.timeScale = 1;
     SceneIsPaused = false;
 }

 public void Pause()
 {
     Debug.Log("Pausing");
     pauseMenuUI.SetActive(true);
     Time.timeScale = 0;
     SceneIsPaused = true;
 }

 public void Menu()
 {
     Debug.Log("Menu Button");
     Time.timeScale = 1;
     SceneIsPaused = false;
     SceneManager.LoadScene("Menu");
 }

 public void QuitGame()
 {
     Debug.Log("Quit Button");
     Application.Quit();
  }
  }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image OmegaGeode · Mar 11 at 04:05 AM 0
Share

I did do it first with SceneManager.LoadScene(0); first since the menu is 1st in the build settings list, then tried this method in case it made any difference.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hsgaminators · Mar 11 at 05:43 AM

Make sure that you have an EventSystem in scene and your buttons are interactable. Don't forget to check if the image on button has Raycast Target on.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

135 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get AI ( Boots ) 1 Answer

Need some pointers towards basics. 0 Answers

Can anyone give the help me with the full Movearound.javascript? 0 Answers

Tutorials Don't work. 1 Answer

good unity tutorials for beginners 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges