Boolean Problem

I don’t know if it’s related to other lines and script is long, so i just copying the problem:

moveCombo = animation.IsPlaying("CharacterState.ComboA1");
	Debug.Log("moveCombo " + moveCombo);
	
if(moveCombo);
	Debug.Log("moveCombo " + moveCombo);

And it prints “moveCombo false” twice in the console as soon as i run the game. How could this happen? I want it to change to true when animation playing, but this is weird, never says true.

You have a “;” after your if! So the second debug line always shows.

This if is dead: you killed it with a semicolon! Remove the semicolon:

if(moveCombo) // no semicolon here!
  Debug.Log("moveCombo " + moveCombo);

You’d better to use curly braces in all if instructions to avoid confusion:

if(moveCombo){ // curly braces make things clearer!
  Debug.Log("moveCombo " + moveCombo);
}