- Home /
What Does error mean : i got it from this line of script......
Assets/textures/NewBehaviourScript 1.cs(4,6): error CS8025: Parsing error
Scipt:
public class Mission : MonoBehaviour
Answer by Peter G · Jan 31, 2011 at 03:57 AM
Besides for the fact that you spelled "Scipt" wrong ;), it is more than likely one of two things.
Make sure that you have a bracket after MonoBehaviour. It could be on the next line though, that's fine.
Maybe you left out a semi-collon ";" after
using SoAndSo;
Look around the line too. Sometimes the compiler doesn't give the actual line the error is on because an error before it confused its line numbering.
ok but can you look to heres the script
using UnityEngine; using System.Collections; public int $$anonymous$$ission public class $$anonymous$$ission : $$anonymous$$onoBehaviour { static public int Count; private const int Required$$anonymous$$illAmount = 10;
void Update()
{
if (Count >= Required$$anonymous$$illAmount)
{
// $$anonymous$$ission complete
}
}
}
It looks like you're trying to declare a variable outside of the class definition. (Also, the variable shares a name with the class, and the declaration is missing a semicolon, but the error is probably due to its being declared outside the class.)
Answer by SisterKy · Aug 10, 2011 at 07:18 PM
I know this is an old-and-abandoned question, sorry to dig it up; but I stumbled upon this and it bothered me... ^^'
using UnityEngine; using System.Collections; public int Mission //<------- PROBLEM public class Mission : MonoBehaviour { static public int Count; private const int RequiredKillAmount = 10; void Update() { if (Count >= RequiredKillAmount) { // Mission complete } } }3 problems at the noted line!
1) as Peter stated, missed a ' ; ' above the line of class-declaration.
2) can't have a variable-declaration outside a class.
3) shouldn't name a variable the same as a class. (use lower case!)
Maybe you tried to give the class a return-value? I don't think that's possible at all (?), but certainly not with this syntax...
Greetz, Ky.
Your answer
Follow this Question
Related Questions
CS8025 Parser error 2 Answers
Parsing error on MeleeSystem script 0 Answers
Script Errors with C# 1 Answer
Errors CS1525 and CS8025.... 1 Answer
Unexpected Symbol and Parsing Errors 0 Answers