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 lilBernier · Dec 29, 2015 at 06:22 AM · unity 5camerauifps

UI Camera Question

I dont understand UI very well. Im getting close to Pre Alpha of my game and id really like to have a pause menu and ive thought of my own UI Pause which switches the main Camera to a second camera with a UI in front of it. But in my main camera i can interfere with the settings which i really dont like cause when im like swinging an axe i hit the music button on the main camera (not in pause menu) and it blast in my ears outa no where,

Id just like to have a good tutorial that will work in unity 5 with out the clicking on stuff in the pause menu on my main camera.Or please give me an explanation on how to fix this. Thanks people of Unity. You are always a big help to answer my questions :)

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 Gnorpelzwerg · Dec 29, 2015 at 09:40 AM 0
Share

please specify your question.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by lilBernier · Dec 29, 2015 at 05:03 PM

how do I fix the UI so I can't interfere with it inside of two cameras.

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
avatar image
0

Answer by Ninjapro2k_ · Dec 20, 2016 at 08:24 PM

Try adding a bool for your pause menu, that returns true when the player presses pause and false when they press it again. This is what I use for my pause menu

public class gameManager : MonoBehaviour {

 bool showMenu = false;

 public GameObject pause;

 void Start () {
     pause.gameObject.SetActive(false);
 }


 void Update() {
     if (Input.GetKeyDown(KeyCode.P) && showMenu == false)
     {
         Debug.Log("p was pressed");
         showMenu = true;
         pause.gameObject.SetActive(true);
         Time.timeScale = 0;
     }


     else if (Input.GetKeyDown(KeyCode.P) && showMenu == true)
     {
         Debug.Log("p was pressed again");
         Time.timeScale = 1;
         showMenu = false;
         pause.gameObject.SetActive(false);
     }

 }
 }

The Pause gameobject is a UI button that takes you to the main menu. Time.timeScale just makes it so it actually stops all everything so the game is really paused.

Hope this helps ^^

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

how do you enable/disable a camera from the new unity 5 fpscontroller camera for a multiplayer game using PUN 1 Answer

My game screen is getting blue for 1 or 2 seconds when i am requesting and getting response ? 0 Answers

OnMouseDown raycast doesnt match UI crosshair 1 Answer

UI element attached to Camera Coordinates 2 Answers

Problem of stuttering FPS Camera 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