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 N00MKRAD · Jul 15, 2014 at 01:54 PM · semicolon

"Insert a semicolon at the end." But there is a semicolon already!!

Hi. I (try to) use the ProgressBar script, but I get this error:

alt text

Here is the script:

 void Update() {
     float revealOffset = (float)(Time.timeSinceLevelLoad % 10) / 10.1F; 
  
     gameObject.renderer.material.SetFloat ("_Cutoff", revealOffset);
 }

As you can see, there IS already a semicolon. What should I do? I tried to insert "var" at the second line, but it didn´t help.

EDIT: Ok, I changed it into C#, now I don´t get this error but I get a new parsing error at the same line...

error.png (4.1 kB)
Comment
Add comment · Show 2
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 Owen-Reynolds · Jul 15, 2014 at 06:41 PM 0
Share

You might try redoing it all in a fresh area. Force yourself to carefully read and check each step. If it works, compare with the version you have now, to see what was wrong (so you know not to do it again.)

If it doesn't work, you'll at least have a more precise question.

avatar image Kiwasi · Jul 15, 2014 at 06:47 PM 0
Share

Unexpected errors or parsing errors often relate to the surrounding code. Strip the class down to the smallest that will give the error, then post the entire class.

Also try the following, don't think it will work, but:

 float revealOffset = (float)((Time.timeSinceLevelLoad % 10) / 10.1F); 

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Landern · Jul 15, 2014 at 01:56 PM

The code you posted is in c# not javascript, use the correct script type and you will be good(maybe?).

// UnityScript(javascript) version if you need

 function Update() {
   var revealOffset : float = (Time.timeSinceLevelLoad % 10) / 10.1F; 
 
   gameObject.renderer.material.SetFloat ("_Cutoff", revealOffset);

}

Comment
Add comment · Show 4 · 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 N00MKRAD · Jul 15, 2014 at 02:01 PM 0
Share

Hm. Now there is a parsing error at the same line.

avatar image Landern · Jul 15, 2014 at 02:05 PM 0
Share

okay, what did you do, did you create a c# script and change the update method? did you use the unityscript version and update your ProgressBar.js? What is the error?

avatar image N00MKRAD · Jul 15, 2014 at 02:05 PM 0
Share

I still get the error on line 2 (In the JS version):

The type "float" does not have a visible constructor that matches the argument list "(float)"

avatar image Landern · Jul 15, 2014 at 02:29 PM 1
Share

Updated unityscript version, my bad.

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

25 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

Related Questions

Script error about the semicolon. 1 Answer

UCE0001: ';' expected. There is one there? 1 Answer

Please insert semi colon... WHAT!?! 2 Answers

insert semicolon error 3 Answers

So my problem is that after I finished coding for my Maze I had gotten a simple error called "UCE0001: ';' expected. Insert a semicolon at the end." This here is my script and the error is on both Lines (9,15) and (10,15). 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