Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by CraftyMaelyss · Jan 19, 2017 at 05:49 AM · uibuttonpause menu

If I add a button to my pause menu, it doesn't show up?

Okay this is pretty weird. My pause menu worked perfectly before and had 5 buttons: resume, help, restart, main menu and quit and all worked just fine. The Unity asked me if I wanted to update and said I should do a back up, so I did that, then went back to test my game only to find that the pause menu I made suddenly won't show up.

So I went to the pause menu and checked the script, thinking that might be the issue as I tried(and failed) to program the BG music to stop playing once paused. That wasn't the problem. So I started unchecking things to see if that was it and apparently it's the buttons.

I have a UIManager script in C# attached to them and it works fine(as I check my main menu, help menu and loading screen and all work properly) however if I enable the buttons, the pause menu won't show up however the game will still pause, it just looks like the screen is frozen until you unpause it.

I'll upload some screenshots of the settings and a copy of my UIManager script as I sincerely have no clue as to why it's suddenly doing this now.

UIManager C# script:

using UnityEngine; using System.Collections;

 public class UIManager : MonoBehaviour
 {
 private GameObject[] PauseMenu;

 // Use this for initialization
 void Start () {
     Time.timeScale = 1;
     PauseMenu = GameObject.FindGameObjectsWithTag("ShowOnPause");
     hidePaused();
 }

 // Update is called once per frame
 void Update () {

     //uses the Esc button to pause and unpause the game
     if(Input.GetKeyDown(KeyCode.Escape))
     {
         if(Time.timeScale == 1)
         {
             Time.timeScale = 0;
             showPaused();
         } else if (Time.timeScale == 0){
             Debug.Log ("high");
             Time.timeScale = 1;
             hidePaused();
         }
     }
 }


 //Reloads the Level
 public void Reload(){
     Application.LoadLevel(Application.loadedLevel);
 }

 //controls the pausing of the scene
 public void pauseControl(){
     if(Time.timeScale == 1)
     {
         Time.timeScale = 0;
         showPaused();
     } else if (Time.timeScale == 0){
         Time.timeScale = 1;
         hidePaused();
     }
 }

 //shows objects with ShowOnPause tag
 public void showPaused(){
     foreach(GameObject g in PauseMenu){
         g.SetActive(true);
     }
 }

 //hides objects with ShowOnPause tag
 public void hidePaused(){
     foreach(GameObject g in PauseMenu){
         g.SetActive(false);
     }
 }

 //loads inputted level
 public void LoadLevel(string level){
     Application.LoadLevel(level);
 }

}

And here's screenshots of the inspector for the buttons: Property of CraftyMaelyss

I'm seriously stuck on this and I would greatly appreciate some advice, even if it's something completely obvious that I've missed, I just need to get this pause menu working again :(

19-jan-2017brokenpausebuttons.png (61.2 kB)
Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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

123 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

Related Questions

UI Buttons Trigger displaced after build. Help Please 0 Answers

UI in World Space doesn't respond 1 Answer

UI in the end of the scene 0 Answers

How am I able to click UI buttons while using the FPScontroller? 1 Answer

How to play different animations with different UI button presses. 1 Answer


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