- Home /
function_parameters
I have got simple function
function activ_colider (col : String): boolean
{
if (col == "something")
return true;
}
Unfortunately, I always get warning :
"Assets/Budowa/FlyBot/FlyBot.js(150,10): BCW0023: WARNING: This method could return default value implicitly."
I do not know what is wrong ? How looks this function properly?
Answer by GuyTidhar · Feb 18, 2013 at 12:59 PM
function activ_colider (col : String): boolean
{
if (col == "something")
return true;
else
return false;
}
I've added the situation when the argument is does not equal "something".
You always must return a value from a function which is defined to return a value.
Cool man. As a general note: when you get a correct answer, please confirm it is so using the button next to the title of the answer.
cheers!
I always thought that the boolean variable is set to false by default. and that is why I could not understand it
Your answer

Follow this Question
Related Questions
C# Function that returns instantiated object 1 Answer
How to call a function from another script. 0 Answers
Return without Break 1 Answer
How can I create a prefab when an object is pressed 1 Answer
Return multiple parameter 3 Answers