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 /
This question was closed Apr 07, 2016 at 10:45 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by niazniz · Apr 07, 2016 at 12:53 AM · unity 5unityeditorunity 4.6pause menuerrormessage

this is my pause menu script but it doesn't pause my game or neither the pause menu disappear however restart works fine

using UnityEngine; using System.Collections;

public class PauseMenu : MonoBehaviour {

 public GameObject PauseUI;

 private bool paused = false;

 void start()
 {
     PauseUI.SetActive (false);
 }

 void update()

 {
     if(Input.GetButtonDown("Pause"))
     
     {
         paused = !paused;
     }

     if(paused)
     
     {
         PauseUI.SetActive (true);
         Time.timeScale = 0;
     }

     if(!paused)
     
     {
         PauseUI.SetActive (false);
         Time.timeScale = 1;
     }
     
 }

 public void Resume ()

 {
     paused = false;
 }

 public void Restart ()

 {
     Application.LoadLevel (Application.loadedLevel);
 }

 public void Quit ()

 {
     Application.Quit ();
 }

 public void MainMenu ()

 {
     Application.LoadLevel (0);
 }

}

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

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by gjf · Apr 06, 2016 at 10:42 PM

are you expecting unity to call start() or update()? it won't.

Start() and Update() on the other hand...

Comment
Add comment · Show 1 · 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
avatar image niazniz · Apr 07, 2016 at 10:45 AM 1
Share

gjf - YOU ARE GENIUS THAN$$anonymous$$SSSSSSSSS A LOTTTT IT works now - my silly mistake but thanks again

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Why IF doesn't work with Instantiate? 1 Answer

public UnityEngine.UI.Text fixing errors. 1 Answer

UI buttons not detecting mouse click/mouseover 1 Answer

Unity UI Test Automation displays error, after compiling 0 Answers

Unity Ads when Internet not available in starting game , how i can iInitialize, in during game when internet be available? 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