C
C#6mo ago
Red Legion

I have a small error that is quite confusing

I am a little new to programming and especially into C# but this part of this code I am trying to understand and edit a little is a little confusing because there is an error and I am, not super sure on how to fix it. I have posted a picture of the code and the error. the photo of the protentional fix doesn't work so I am just posting this here so i am making it clear that that doesn't work
No description
No description
No description
4 Replies
Pobiega
Pobiega6mo ago
you can't declare a method just anywhere in this case, it seems you are trying to declare one inside an if-statement
Red Legion
Red LegionOP6mo ago
yes, that makes sense thanks
Red Legion
Red LegionOP6mo ago
well um if I get rid of it I need it to have another piece of code is not declared or whateverso there is an error
No description
Pobiega
Pobiega6mo ago
I'd suggest just declaring the method somewhere else like, on the class you are currently in? then call your method inside the if-statement instead of declaring it there declaring a method does not call it
Want results from more Discord servers?
Add your server