I have an equip script, that equips weapons based on what game object you click on. Weapons have a “class” with different parameters such as damage, max ammo… etc. I’m using an boolean to see if its active and I need to know how to “switch from main gun to a sidearm.” IE, user presses 1, and the main gun that is equipped becomes active, and when the user presses 2, the sidearm becomes active and the main gun becomes inactive. Any ideas?
if(Input.GetButtonDown(“1”) //“1” is the name you put in Edit->Project Settings->Input
{
if(!Primary.IsActive)
{
Primary.IsActive = true;
Current.IsActive = false;
}
}
else if(Input.GetButtonDown(“2”)
{
if(!Secondary.IsActive)
{
Secondary.IsActive = true;
Current.IsActive = false;
}
}