Problem is not reproducible or outdated
Not all code paths return a value error on a void function
I'm very new to both C# and Unity, so sorry if this is a stupid question, but how do I get rid of error CS0161? I had thought that classifying a function as "void" meant it didn't need to return a value. My code is as follows.
void becomeUnstoppable () {
DA = 1;
}
void becomeStoppable (){
DA = 0;
}
I'm getting the error for both functions
I would guess that the error is referring to somewhere else. What's the rest of your code, and include the full error message.
I figured it out, the error was in reference to a different script. Thanks for the help, and sorry for wasting your time.
Follow this Question
Related Questions
SendMessage has no reciever 0 Answers
Game Does Not Work Properly 0 Answers
How to call functions from another script c# (Unity5) 1 Answer
not all code paths return a value? 1 Answer
Please help! Public Void unexpected, school project! 1 Answer