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 Fingal · May 09, 2014 at 05:32 PM · javascripterror

Error BCE0044 JavaScript

Hello, i have written a script that declares some variables, when i try to use the script, it gives me the error "BCE0044: expecting }, found 'public'." the "public", by the way, is from a "Public Var". Also, it gives me another error about the end of the script ; BCE0044: expecting EOF, found '}'.

Is there anyone who can suggest how i can get rid of this error?

 function start () {
 
 public var levelplayauth1 = false;
 public var levelplayauth2 = false;
 public var levelplayauth3 = false;
 public var levelplayauth4 = false;
 public var levelplayauth5 = false;
 public var levelplayauth6 = false;
 public var levelplayauth7 = false;
 public var levelplayauth8 = false;
 public var levelplayauth9 = false;
 public var levelplayauth10 = false;
 public var levelplayauth11 = false;
 public var levelplayauth12 = false;
 public var levelplayauth13 = false;
 public var levelplayauth14 = false;
 public var levelplayauth15 = false;
 public var levelplayauth16 = false;
 public var levelplayauth17 = false;
 public var levelplayauth18 = false;
 public var levelplayauth19 = false;
 public var levelplayauth20 = false;
 public var levelplayauth21 = false;
 public var levelplayauth22 = false;
 public var levelplayauth23 = false;
 public var levelplayauth24 = false;
 public var levelplayauth25 = false;
 public var packplayauth1 =  0;
 public var packplayauth2 =  0;
 public var packplayauth3 =  0;
 public var packplayauth4 =  0;
 public var packplayauth5 =  0;
 public var HillyPadlock : GUITexture;
 public var NightPadlock : GUITexture;
 public var HighPadlock : GUITexture;
 public var MultiplePadlock : GUITexture;
 
 HillyPadlock.enabled = true;
 NightPadlock.enabled = true;
 HighPadlock.enabled = true;
 MultiplePadlock.enabled = true;
 
 if(packplayauth1 >= 5)
 {
 HillyPadlock.enabled = false;
 }
 if(packplayauth2 >= 5)
 {
 NightPadlock.enabled = false;
 }
 if(packplayauth3 >= 5)
 {
 HighPadlock.enabled = false;
 }
 if(packplayauth4 >= 5)
 {
 MultiplePadlock.enabled = false;
 }
 
 }

That's the code by the way

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · May 09, 2014 at 05:33 PM

You don't use 'public' for variables declared inside a function. I think you want to declare these variables outside of 'Start()'. Note you have 'start' with a lower case 's'. This will not be called by Unity. You need 'Start()' with an upper case 'S'.

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

20 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

Related Questions

A node in a childnode? 1 Answer

Destroy Other 2 Answers

Unexpected token: private. Error. Can anyone help? 2 Answers

Scripting Error Help Needed 2 Answers

When I kill one enemy, the rest disapear, but still shoot 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