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 Chanindu · Jun 29, 2021 at 04:06 AM · gameobjectbuttonscene

How to get the button Working?

Hi, I am making a main menu for my game, and I'm terribly new to Unity, I made a UI for the Main Men, I finally Created the Main Menu, ( i dont use scripts for i dunno how to make a lot of scripts for Im new, I have disabled the Free-Flight Menu GameObject and the Main Menu Gameobject activated, i want, when the free-flight button is pressed, that the main menu gameobject disables and The free-flight gameobject activated. When i attached the disabled Menu to the On-Click thing in the button they ask for a whole list of things like Transform, Gameobject, in those 2 Menu's they show a lot of Settings to choose, which one should i choose to Disable One GameObject and instantly Activate the other Gameobject (Disabling the Main Menu and Enabling the Free-Flight Menu, (When a button is pressed)

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Devster2020 · Jun 29, 2021 at 09:13 AM

Hello @Chanindu!
The solution is simple:

Add to the button OnClick method, 2 action rows by clicking on the PLUS icon alt text
In the first, drag the "MainMenu" gameObject, and in the second the "FreeFlight" gameObject.
In the "function" list, find "GameObject-->SetActive()" alt text


Check the second, leaving unchecked the first.
Tadà!!!


schermata-2021-06-29-alle-110840.png (36.0 kB)
schermata-2021-06-29-alle-111220.png (168.4 kB)
Comment
Add comment · Show 7 · 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 Chanindu · Jun 30, 2021 at 04:52 AM 0
Share

@Devster2020 its not working at all, when i click the free-flight button it gets offed and the free-flight menu never activated, or if thats unable, how ought to i do it if the free-flight menu and main menu were 2 Different scene's,

avatar image Chanindu Chanindu · Jun 30, 2021 at 04:56 AM 0
Share

and it only disables the main menu, i need the free-flight gameobject to get activated right after the MainMenu disables when the button is pressed

avatar image Chanindu Chanindu · Jun 30, 2021 at 05:04 AM 0
Share

And i dont see the settings you see in my editor,

avatar image Devster2020 Chanindu · Jun 30, 2021 at 08:38 AM 0
Share

If the gameObjects to enable/disable are in 2 different scene, you CAN'T do it without coding.. Using a script is the only way..
If the objects are in the same scene, exchange their position.. first in the list the object to enable, and second the object to disable.

avatar image Chanindu Devster2020 · Jun 30, 2021 at 10:24 AM 0
Share

the objects ARE in the same, scene, i will try, thanks for your help

Show more comments
avatar image
0

Answer by In0sc0p3dJFK · Jun 29, 2021 at 09:01 AM

this is going to need some scripting. it is not hard at all though. But you will need to be more specific in order for this question to be answered.

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

208 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 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 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

Best Button for UnityGame 2D 1 Answer

Generalizing My GameObjects And Scripts in Unity 0 Answers

Regarding setActive 4 Answers

unity code with C# back to previous scene 1 Answer

Changing gameobject material color makes object disappear from view. How can I fix this? 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