#pragma strict
function Update ()
{
if (Input.GetAxis(“Mouse ScrollWheel”))
{
SwapWeapons();
}
}
function SwapWeapons ()
{
if (Weapon01.active == true)
{
Weapon01.SetActive(false);
Weapon02.SetActive(true);
}
else
{
Weapon01.SetActive(true);
Weapon02.SetActive(false);
}
}
Using this code I am getting an weird “bug” where it is running the if and the else with one scroll of the wheel. I’ve worked on this all day but I haven’t found a solution.