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 /
avatar image
0
Question by damaskox_unity · Sep 09, 2017 at 07:55 PM · buttonscript.deactivatewithoutmessagebox

Can I deactivate a messagebox without any scripting?

Greetings to you all!

I did some research about my problem in advance through Google, but I found only solutions WITH scripting.


Today I started to build up my first "something" I could call a game at some day, if I'm up to see it to the end.

From a button and a message box tutorial videos in YouTube I learned to make basic buttons and two basic(?) message boxes.

Through poking around between the button object and a panel with text in it I was able to open a message box through clicking a button. I did this without scripting, since I kinda like the way to get stuff working without scripting (as long as I can help to avoid it).

So, through the GameObject.SetActive -command (chosen from the dropdown list) I managed to open the message box. I added an X-button on the messagebox and hoped to find a function similar to mentioned before to do the reverse action - again, without coding.

To my slight astonishment however, I didn't see any of the sort. I couldn't find any alternative function available in the dropdown list to my little X-button in my message box to close my message box. (Or I couldn't know/understand that any of the given commands could do the trick)

Is there any way to get a function to close a message box (through a button inside the message box) without coding? If not, I need to figure out, how to code the function and how to add it in the right place =(

Thanks in advance!

(I also wish to be able to reopen that message box when you click the same button, so I am not looking for options to completely/fully disable the message box)

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 ShroomWasTaken · Sep 09, 2017 at 08:02 PM 0
Share

Isn't there a little checkbox next to the buttons SetActive event? I believe there should be, if it's set to unchecked it will disable the message, making it invisble. alt text

skarmklipp.png (25.4 kB)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TheSOULDev · Sep 10, 2017 at 12:28 PM

Unless you literally have a full "for dummies" engine in Unity (like RPG Maker), you won't be able to do anything significant without scripting. To make a messagebox close when a button is pressed in the same message box, add a button component to the game object you want to act as a button, then open up your message box script, add a function that looks something like this:

 public void CloseMessageBox(GameObject MessageBox)
 {
     MessageBox.SetActive(false);
     return;
 }

And add that method to the button component OnClick() Unity Event.

If you want the function to act as a toggle, use this:

 public void ToggleMessageBox(GameObject MessageBox)
     {
         MessageBox.SetActive(!MessageBox.activeSelf);
         return;
     }
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

83 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

Related Questions

how can I disapear a button after push? 1 Answer

GUI Button scripting 0 Answers

Children of DualTouchControls prefab keep being forced to active 0 Answers

Button onClick based on image (sprite) on Button 1 Answer

Button press for Animations 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