I have 10 elements from 0 to 9, when I do this script, I get an error at runtime;
“Failed to call function checkViewList of class PlanetMenu.
Call function checkViewList with no parameters but the function requires 1.”
if (currentSystemM == "Galaxy" ) Camera.main.SendMessage("checkViewList", 0);
void checkViewList(int goVisit){
// My codes are here
}
All numbers are accepted, but not “0”, but my elements start with 0. My first element is Galaxy 0, 2nd is Galaxy 1 etc.
When I add this short line it works, but what is the difference, it’s still 0.
var Button = 0;
if (currentSystemM == "Galaxy" ) Camera.main.SendMessage("checkViewList", Button);
Is there anyway I can still use “0” without using “var button = 0;”? It accepts any number except 0, is it a bug in unity?