My code was running perfectly, but all of a sudden things started to go awry. For some reason, one of my booleans will just switch from false to true and vice versa, even though there is no code that would make it do such a thing. You can see in the code below that I have a print statement at the top and at the bottom, and although they should both print out the same boolean value, they do not. The update function is the only function running in this script, so I don’t know why this is happening. Any suggestions as to what I should do will be greatly appreciated.
void Update () {
print ("6: " + seaweed1Started);
if (true) {
seaweed1Started = objectPlacement (seaweed1, 200, seaweed1Started, 0);
}
print ("5: " + seaweed1Started);
}