I have tried a lot of things, but still i can not solve the problem.
The error is "Keyword ‘void’ cannot be used in this context (37,28) "
I apologize for keeping you busy.
I have tried a lot of things, but still i can not solve the problem.
The error is "Keyword ‘void’ cannot be used in this context (37,28) "
I apologize for keeping you busy.
Hi Derin,
Your methods are missing closing } characters.
For each opening ( or { you must ensure that you have a corresponding closing ) or }.
There are two good ways to help you spot these;
Note: If you use a built-in tool, there’s still no excuse for not having clean / consistant code.
Example;
Your current Update() method;
// Update is called once per frame
void Update () {
print (myState);
if (myState == States.devam_0){
States_devam_0 ();
} else if (myState == States.sokak) {
States_sokak ();
} else if (myState == States.kv_0){
States_kv_0 ();
} else if (myState == States.cv_0){
States_cv_0 (); }
else if (myState == States.devam_1){
States_devam_1 ();
}
A tidier version of your Update() method, with the opening curly braces at the end of each opening statement;
// Update is called once per frame
void Update () { // opening method curly brace
print (myState);
if (myState == States.devam_0) {
States_devam_0 ();
} else if (myState == States.sokak) {
States_sokak ();
} else if (myState == States.kv_0) {
States_kv_0 ();
} else if (myState == States.cv_0) {
States_cv_0 ();
} else if (myState == States.devam_1) {
States_devam_1 ();
}
} // missing closing curly brace
or, with the opening and closing braces on new lines;
// Update is called once per frame
void Update ()
{ // opening method curly brace
print (myState);
if (myState == States.devam_0)
{
States_devam_0 ();
}
else if (myState == States.sokak)
{
States_sokak ();
}
else if (myState == States.kv_0)
{
States_kv_0 ();
}
else if (myState == States.cv_0)
{
States_cv_0 ();
}
else if (myState == States.devam_1)
{
States_devam_1 ();
}
} // missing closing curly brace
So, go through your code and look for the missing curly braces / brackets, and then keep you code tidy so that you can spot these things more easily
Also, you can just paste your code into your posts which may make it easier for people to help you, see the User Guide below on formatting.
See also;
Thanks, again
No problem at all