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 UndyingWar · Oct 24, 2015 at 04:29 PM · scripting problemuimenu

How can I set up an in-game menu?

So I'm trying to make it so if I click the "Menu" Button in the top left corner, a menu comes up. Then on that menu, you can click "Resume" or "Exit". Here's what it looks like. http://prntscr.com/8utezl

I've been trying to get a working script for it, here's what I have so far, but I'm having issues. http://prntscr.com/8utfeq

I managed to get a Main Menu working last night, but I can't figure out how to get this in-game menu working. I would like the "Menu" button to open up the menu, and the "Resume" button to close the menu, and the "Exit" button to go back to the main menu.

Any help would be greatly appreciated :P

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 Statement · Oct 24, 2015 at 10:49 PM 0
Share

Tip: Please don't paste code as an image. Put it in the post or if it's lengthy, provide a link to pastebin or some other place where we can get the code. I don't want to install OCR software to get the text to my clipboard. Doing so will decrease friction for people who want to help you and you're more prone to get an answer.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Statement · Oct 24, 2015 at 10:56 PM

If you want to set it up with the inspector, select the button, add On Click event handlers and route them to your canvas / GameObject.SetActive.

If you want to set up callbacks with code:

 menuButton.onClick.AddListener(() => MenuCanvas.SetActive(true));
 resumeText.onClick.AddListener(() => MenuCanvas.SetActive(false));
 exitText.onClick.AddListener(() => GameUICanvas.SetActive(true));

Or something similar...

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Pause menu done exactly according to tutorial doesen't work 2 Answers

Ship selection menu during game 0 Answers

UI Dropdown problem. 1 Answer

How to get access to other's script var with increment? 0 Answers

Making UI block rays with touch inputs 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