• 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 $$anonymous$$ · Sep 26, 2013 at 07:22 PM · guijava

i don't understand compiler errors here...

I am trying to make all my statistics be deleted and when delete a confirmation box appears, I am using a boolean for showing the GUI. The code is giving me the following errors some of which are not true?

alt text

 boolean Draw = true;
 
 function OnMouseDown () {
     if (Draw == true){
         PlayerPrefs.DeleteAll();
         if(GUI.Button(Rect(0, 0, 200, 100 "Statistics Deleted"))}
         {
             Draw = false;
         }
     }
 }


e7e9a3bbb16109b36a2ece94e67ff2c7.png (18.0 kB)
Comment
Add comment · Show 4
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 Graham-Dunnett ♦♦ · Sep 26, 2013 at 07:23 PM 0
Share

The compiler doesn't lie. It's not a human hidden in your computer. It's a piece of software trying to make an educated guess at what the human who wrote the code and made mistakes actually meant.

avatar image $$anonymous$$ · Sep 26, 2013 at 07:26 PM 0
Share

It was sarcasm :P...

avatar image Graham-Dunnett ♦♦ · Sep 26, 2013 at 07:29 PM 0
Share

Oh. Still doesn't make it a good title for a question. ;-)

avatar image Fattie · Sep 27, 2013 at 06:56 AM 0
Share

Half, I pepper the forum with subtle jokes, but, there's no room for meaningless titles

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Graham-Dunnett · Sep 26, 2013 at 07:28 PM

  1. Line 1 - isn't valid Javascript. Use var name : class = value; syntax.

  2. Line 6 - needs a closing parenthesis after the 100 and then a comma.

  3. Line 6 - what's the closing brace meant to be used for?

  4. Line 8 - since line 1 messed up the variable name the compiler doesn't know what Draw is. Or maybe the erroneous closing brace on line 6 has confused the compiler.

Comment
Add comment · Show 3 · 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 $$anonymous$$ · Sep 26, 2013 at 07:33 PM 0
Share

Oh man that's embarrassing. Thanks!

avatar image tanoshimi · Sep 26, 2013 at 07:34 PM 0
Share

Errors on lines 1, 6, 6, and 8, you say? Wow! Those are exactly the same line numbers as reported by that dirty, lying compiler ;)

avatar image $$anonymous$$ · Sep 26, 2013 at 07:36 PM 0
Share

shhhhhhhh!

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

How to make the tab key to show/hide GUIlayer 1 Answer

An instance of type 'Script' is required to access non static member 'Variable' 1 Answer

Achievement System 2 Answers

GUI box problem? 0 Answers

Stand alone player 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