Hello! I am working on adding boss-states. I am working off my prior knowledge and creating states out of logical if statements and boolean variables. So, what I got working right now, is that it does pick a random new number, then sets the boolean in range of the number given to true, and sets both of them false when my timer is at 1 (1 second before I assign a new random number).
The problem, is that when I try to collect the method for “BossProjectileAttack()” or “BossSpiralAttack()” it just always remains true, and/or bugs out.
Relevant code:
public bool spiralAttack = false;
public bool projectAttack = false;
void Update () {
if(attackStateChange > 0) {
attackStateChange -= Time.deltaTime;
}
if(attackStateChange < 0) {
attackStateChange = 0;
}
if(attackStateChange == 0) {
attackStateChange = attackStateTimer;
float rand = Random.RandomRange(1,10);
if(rand < 5) {
spiralAttack = true;
}else {spiralAttack = false;}
if(rand >= 5) {
projectAttack = true;
}else {projectAttack = false;}
}
else if(attackStateChange == 1) {
spiralAttack = false;
projectAttack = false;
}
/*HELP IS NEEDED HERE
if spiralAttack = true, then BossSpiralAttack, OR
while spiralAttack = true, then BossSpiralAttack
?*/
void BossProjectileBasic(){
//blablabla
}
void BossSpiralAttack(){
//blablabla
}