Hi everyone! So basically, i have a while loop:
j = (CubzTarg.CubzSettings[CubzTarg.cubzSelected].OnCase); //This value is picked between 0 and 48 depending on what i do in runtime, doesn't matter
Debug.Log(j);
while(j != 0 || j != 7 || j != 14 || j != 21 || j != 28 || j != 35 || j!= 42){
j-=1;
Debug.Log(j);
}
Debug.Log(j);
And i really don’t understand why my loop is infinite. It was not even taken in count first, but then i decided to put all the possible cases separately, just so i’m clearer, but it’s still not working; AND (brace yourselves) I’ve got none of the debug output that are showing. Not even the one that’s before my presumed infinite while loop that makes my unity crash.
here’s the whole fonction, that i modified just a bit, just to verify some things, but it’s still not working and only debug.
public void ChoseLin(){
j = (CubzTarg.CubzSettings[CubzTarg.cubzSelected].OnCase);
Debug.Log(j);
while(j != 0 || j != 7 || j != 14 || j != 21 || j != 28 || j != 35 || j!= 42){
j = j-1;
Debug.Log(j);
}
Debug.Log(j);
for(int i = j; i < j+7; i++ ){
if(CaseTarg.CaseSettings[i].cubzOn != null){
CaseTarg.CaseSettings[i].cubzOn.GetComponent<Kubzz>().revealed = true;
Destroy(CaseTarg.CaseSettings[i].cubzOn, (2+(i/10)));
}
}
ChoiceRay.SetActive(false);
}
This is a function called when i click on a button.
By the way, not really related but i wanted to apologize because i’ve been posting a lot of my problems recently (At least one problem for each time i tried to get some things done in my game)
Thank you, Thomas.