Edit: Changed the title to be more accurate as to what the problem is.
Hey everybody.
I’ve been trying to resolve an issue for the better part of a day now and the behavior isn’t making any sense to me.
I have a round based FPS where the player has to take out a number of enemies to advance to the next level. In order to scale up the challenge, each level increases that goal value, and every few rounds (Specified in a variable as a fixed value), the spawn timer for enemies will decrease by 2 seconds until it eventually reaches a minimum value of 2 seconds.
What is happening is that the first few rounds work perfectly; but when the round is reached at which the timer should decrease, it appears to work. The following rounds though will revert this value to the original timer value.
I’m doing the check against whether to decrease the timer using a modulo - Current Round % “Variable at which the decrease should happen” == 0 on a branch. If it is true, the timer is decreased by 2 and then put into a MAX comparison to make sure the value never goes below 2 seconds and then the timer value is set to this new number.
I have no clue why this is happening. It seems that the original timer value is being reapplied to the variable timer value any time the branch is false…
Any help with this would be greatly appreciated because I’m about ready to give up and just use an array with the timer values for the first 100 rounds.