Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by Richard 3 · May 03, 2012 at 01:05 PM · guibuttonclickwindowthrough

Stop clicking through a GUI window

Hi

I have a GUI menu in a game I'm working on for IOS. One of the buttons opens a GUI window which fills the screen, loads ontop of the menu and has its own set of buttons. My problem is I am able to click through the GUI window and select one of the buttons in the menu. Is the any way to stop this.

I sure there is a simple solution to this.

Thanks.

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 Greg Dunn · May 04, 2012 at 01:29 PM 0
Share

I don't know if it'd work in that specific instance, but if you want a really quick & dirty solution, you can often just put a box there that covers up the whole screen/scene, turn off it's mesh renderer (so it's invisible) and leave the collider on it alone, which should catch the clicks.

The proper solution would be to test against a variable, like Phillip mentioned. But while this is FAR from elegant, it's very helpful in some situations.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Piflik · May 03, 2012 at 01:39 PM

Add a variable that is set false when you open the second window and test against it in the menu.

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 Richard 3 · May 04, 2012 at 12:54 PM 0
Share

Is there no way to simply ad a collider or something similar to stop the click through?

avatar image
0

Answer by Berenger · May 04, 2012 at 03:01 PM

Physic things won't stop the GUI from being clicked, unless you are using GUITexture / Text and OnMouse...().

You'll need a reference to the script displaying the menu GUI so you can disable it when the window is opened. You don't to draw things you won't see.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Blocking Click through on GUI components 0 Answers

Add EditorUI elements when a button is pressed 0 Answers

New GUI and Inventory problem. 1 Answer

UI - click through image 2 Answers

After Adding GUIStyle to GUI.Button, it is no longer clickable 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