Float variable keeps resetting to its default value

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.

maybe not the answer you are looking for but, have you tried print stringing all the values, 1 by 1 to make sure they are how you want them to be…?

I’ve ran into some weird float variable behaviors recently, and was only able to fix it by deleted the variable(s), compiling the BP, and then re-create the variable with a different name…

Maybe worth a try if haven’t yet…

I gave that a try but no luck. Thanks for the idea though.

Hi, have you found the solution?