This is a bit hard for me to explain. I’m trying to have one bar fill up while a key is held, but if you release the same key, it should switch and fill up the other bar. But it doesn’t and keeps filling up the first bar.
I hope these screenshots help explain what I’m trying to do.
mod, or modulo is a way to find out what’s left over when you divide one number by another. For example, if you divide 17 by 5, you get 3 with a remainder of 2, so mod(17,5) equals 2. This means that when you divide 17 by 5, the leftover is 2. In simpler terms, it helps us know how many times the divisor fits into the dividend, and the result is the leftover part.
So if CurrentAttack is 0, then (0+1) / 2 has a remainder of 1
If CurrentAttack is 1, then (1+1) / 2 has a remainder of 0