I’m making this game where the input you enter must match the sprite showing.
For some reason it ignores all the if statments and goes staright
if (Input.GetKeyDown (KeyCode.DownArrow)) {
// Debug.Log (“DownInput”);
if (transform.Find (“Circle/CircleYellow”).GetComponent ().enabled == true) {
transform.Find (“Circle/CircleYellow”).GetComponent ().enabled = false;
Debug.Log (“YES”);
ShapeShifterVoid ();
score = score + 1;
Score ();
anim.SetBool (“CorrectAnswer”, true);
} else if (transform.Find (“Circle/CircleBlue”).GetComponent ().enabled == true) {
transform.Find (“Circle/CircleBlue”).GetComponent ().enabled = false;
Debug.Log (“YES”);
ShapeShifterVoid ();
score = score + 1;
Score ();
anim.SetBool (“CorrectAnswer”, true);
} else if (transform.Find (“Circle/CircleGreen”).GetComponent ().enabled == true) {
transform.Find (“Circle/CircleGreen”).GetComponent ().enabled = false;
Debug.Log (“YES”);
ShapeShifterVoid ();
score = score + 1;
Score ();
anim.SetBool (“CorrectAnswer”, true);
} else if (transform.Find (“Circle/CircleRed”).GetComponent ().enabled == true) {
transform.Find (“Circle/CircleRed”).GetComponent ().enabled = false;
Debug.Log (“YES”);
ShapeShifterVoid ();
score = score + 1;
Score ();
} else {
// Debug.Log (“WHY”);
// timerScript.WrongAnswer ();
anim.SetBool (“CorrectAnswer”, false);
cameraShake.Incorrect ();
// score = score - 5;
// Score ();
// vtransform.Find (“black”).GetComponent ().enabled = true;
// StartCoroutine (WaitTime ());
}
}