my bool is not getting set to true… whats the issue…
help…
code:
if (choppingBoardSelectIndexP1 == 1 )
{
bTwoVegSelectedP1 = true;
}
bTwoVegSelectedP1 is false after this…
my bool is not getting set to true… whats the issue…
help…
code:
if (choppingBoardSelectIndexP1 == 1 )
{
bTwoVegSelectedP1 = true;
}
bTwoVegSelectedP1 is false after this…
Probably because choppingBoardSelectIndexP1 is not 1?
You need to debug what is this and why it isn’t 1 when you expect it to be that. Could you post your entire script useing code tags? Using code tags properly
I agree with Ninja. Honestly, we just need more information as well. Are you ever setting that bool back to false or is it supposed to stay true once that choppingBoard variable is equal to 1?
You should post the entire script, because the reason why it is false is most likely in the surrounding code.
i logged choppingBoardSelectIndexP1 for values 0 to 8 or more… it is in input.getkeydown() function
it is definately setting to 1 and bool was not setting to true…
i resolved this issue by copy and pasting entire script in to a new script with new file and new name…
…
That wouldn’t have fixed the logic. There was some other issue. Maybe you had multiple instances of the script in your scene when you didn’t expect to for example.