We have a static var bCounter. bCounter is initialized to 0, and will sometimes be incremented in another function. Every time our script updates it goes through a serious of ifs to determine what to do based on bCounter. However, our script’s update function won’t even recognize when bCounter is 0 (which we are testing for using the print statements.) Why won’t the update even do the first if statement?
function Update ()
{
if (bCounter == 0)
print("Still this far!");
else if (bCounter == 1)
{
print("Good job!");
if (bThirteen == true && Time.time - temp13 < 1)
{
Stair13.transform.Translate(0,Time.deltaTime * 13.73371,0);
}
else if(bThirteen == false)
bCounter = 0;
}