Hi. I (try to) use the ProgressBar script, but I get this error:
![]()
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…
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.
– Owen-ReynoldsUnexpected 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);
– Kiwasi