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 Max Designer · Jan 31, 2013 at 07:31 PM · monodevelopmenujava

How can i make a main menu?

I make to make a main menu, i am trying to use 3D text and a Cube as the background but i'm having problems when i click on the 3D Text for it to go to the next sence, some is wrong with MonoDevelop, i check over and over to see if my script is correct and it is... For example: if i am a button (3d Text) to go to Help Menu and i write my Script as in:

 var help : boolean;
 var option : boolean;
 
 function OnMouseUp()
 {
 
   if(help)
   {
   Application.LoadLevel(1);
   }
 
   else if(option)
   {
   Application.LoadLevel(2);
   }
 }

it will not go to help but go to option, and i check to see if the button is check for help in the inspector...

Comment
Add comment · Show 7
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 Julien-Lynge · Jan 31, 2013 at 10:11 PM 0
Share

Please add debug statements to make sure a) that you're getting into the On$$anonymous$$ouseUp function, and b) that the values of help and option are what you think they are.

avatar image Max Designer · Feb 01, 2013 at 01:34 AM 0
Share

Ah this is an example, my Script i wrote works fine. I check it over and over to see if it's right but Unity is mixing up my levels in the build setting under file and i don't know if it's the language my script is rote in because i only know how to write C# only JAVA so i don't know if something is wrong with the language or Unity itself.

avatar image Loius · Feb 01, 2013 at 01:48 AM 0
Share

Unity doesn't mix up levels; post your code so you can get help.

avatar image T27M · Feb 01, 2013 at 03:14 AM 0
Share

I often use the name of my levels when loading them, LoadLevel(1) isn't very helpful at a quick glance.

avatar image iwaldrop · Feb 01, 2013 at 08:04 PM 2
Share

http://lmgtfy.com/?q=Application.LoadLevel

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by LukeAntConroy · Feb 04, 2013 at 09:20 PM

Just something I had done previously it may help although it is in C# so you probably have to change it. Hopefully thats it helps.

public class Menu : MonoBehaviour {

 public bool isQuit = true;
 
 void OnMouseEnter()
 {
     renderer.material.color = Color.red;
 }
 void OnMouseExit()    
 {
     renderer.material.color = Color.yellow;
 }
 
 void OnMouseDown()
 {
     if(isQuit)
     {
         Application.Quit();
     }
     else
     {
         Application.LoadLevel("Main");
     }
 }
 
 // Update is called once per frame
 void Update () {
 
 }

}

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

13 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

Related Questions

Monodevelop doesnt pick up Javascript 1 Answer

having trouble with a return to main menu script 1 Answer

how do i make when i click on a candle it out and when i click back on it, it's light? 1 Answer

Main menu camera change script. 1 Answer

How to fix menu colors in mono develop 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