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 Dec 06, 2016 at 02:16 AM by VHLS2 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by VHLS2 · Dec 05, 2016 at 06:08 PM · scripting problemcanvasscalepause menu

hey im trying to make a pause menu, it keeps poping up at the start and i have no idea how to fix.

when i start up the game the canvas pops up, i dont know what im doing wrong: here is my canvas script

using UnityEngine; using System.Collections;

public class PauseGame : MonoBehaviour { public Transform canvas;

 // Update is called once per frame
 void Update () {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Pause();
     }
 }
 public void Pause()
 {
     if (canvas.gameObject.activeInHierarchy == false)
     {
         canvas.gameObject.SetActive(true);
         Time.timeScale = 0;
         AudioListener.volume = 0;
     }
     else
     {
         canvas.gameObject.SetActive(false);
         Time.timeScale = 1;
         AudioListener.volume = 1;
     }
 }

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

}

im trying to disable it at the start in game manger but it wont let me add it to the script. anyone have any idea they would be much appreciated

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

Answer by $$anonymous$$ · Dec 05, 2016 at 06:27 PM

I think that you should declare it as false in the Start method.

Comment
Add comment · Show 2 · 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 VHLS2 · Dec 06, 2016 at 02:15 AM 0
Share

thanks, i tried that at the start but when i tried to activate it, there wasn't a pop up. after i rebooted unity it worked. thanks

avatar image $$anonymous$$ VHLS2 · Dec 06, 2016 at 12:45 PM 0
Share

@VHLS2 if you found the answer useful please accept it and vote up.

Follow this Question

Answers Answers and Comments

96 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

Related Questions

Get single component from canvas, instead of all components 1 Answer

How to get the Cursor to be visible after returning to main menu. 1 Answer

Unity 5 - Manually zooming/scaling in and out of an image with a text layer while still retaining text sharpness when zoomed? 0 Answers

Instantiate Prefab From Script Inside A Canvas 2 Answers

How to run a script twice in a scene 2 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