Hi all. I ran into a problem thats literally driving me go crazy, it even sounds crazy. So in Start(), i set the battleState = “Start.” Then call a function that eventually changes battleState = “Battling.” I have battleState as a public variable in the inspector, also have a print(battleState) in Update(). The log is printing “Battling” and the inspector says battleState is “Battling.” All is good. Then i push a button that calls the function above (IsBattling()), it returns false, prints “Start” once, all while the log is printing “Battling” and the inspector says battleState is “Battling.” Dont understand how thats possible but would love any help. Pretty sure i gave all necessary info, but will give any on request! Thank you!
hi raarc, the only time i set battleState to “Start” is the first line of code in Start(). Then I call StartBattle() after that, which does a few things but then sets the battleState to “Battling.” At the end of StartBattle() it does an if statement saying if(IsBattling() That activates a Canvas with buttons on it. The canvas activates, so IsBattling works and the battleState is correct , but then does nothing until a button is pressed. But the button never gets pressed because when i click it, it first sees if(IsBattling()) which does not work, returning battleState = “Start.” Like i said, crazy! no where else changes battleState to start, No idea why it does when i push a button