creating a simple parameter?

Im trying to make a state where when the player cannot fire while the gun is reloading, so I am trying to approach this by making a variable or something start at 1, but when "r" is pressed, it changes this variable to 0, the animation plays, all reload code is run, and THEN it is changed back to 1.

My plan is to make the Fire function create a bullet if (you have ammo) and then another if (this variable = 1). However I am having trouble instituting a variable, or any other way I can accomplish this. Any suggestions?

1 Answer

1

Ahhh nvm, I made a private variable that works perfectly :)