Making variable False or true without Boolean

So i made a Question in Questions tab but its awayting moderator like 2 hours now and iam stuck in one place
so the problem is i have primary and secondary weapons

 public int currentweaponprimary = 0;
public int currentweaponsecondary = 0;

but i need them to be active one at a time like this

 if (Input.GetButton ("1"))
         {
             currentweaponprimary.enabled = true ;
             currentweaponsecondary = false ;
         }
if (Input.GetButton ("2"))
         {
             currentweaponprimary.enabled = false ;
             currentweaponsecondary = true;
         }

this wount work i know it because the int need to be bools for them to be false or true this is just an example of what i would like and i cant figure out a code that would work like this ?

Honestly, I would have a seperate bool to determine if primary is true. (If false, equip secondary)

Then have your int values to represent which weapon you’re using.

At least, that’s if I understand your problem correctly.

well that would work but how would i make make that when primary is on secodary wount shoot if secodary is on primary wount shoot iam kinda new

Just enable one, and disable the other. What exactly is the difficulty?

Check out Enums for this.

2 Likes