AWP, and other secondary weapons are not working. It seems that the code does not execute the line:
playerShooter.Shoot(x);
I don’t know why my whole function looks like this:
public void PerformShoot()
{
if (Input.GetMouseButton(0))
{
if (playerShooter.primaryWeaponOn() == true && playerShooter.ammoCurrentInt > 0)
{
switch (gameManager.GetComponent<GameManager>().primarySelected)
{
case "ak47":
playerShooter.Shoot(0.1f);
break;
case "m4a1":
playerShooter.Shoot(0.08f);
break;
case "scorpionvz":
playerShooter.Shoot(0.07f);
break;
case "ump45":
playerShooter.Shoot(0.11f);
break;
}
}
}
else if (Input.GetMouseButtonDown(0))
{
if (playerShooter.ammoCurrentInt > 0 && playerShooter.primaryWeaponOn() == true)
{
switch(gameManager.GetComponent<GameManager>().primarySelected)
{
case "awp":
playerShooter.Shoot(1.4f);
break;
}
}
else if (playerShooter.ammoCurrentIntSec > 0 && playerShooter.secondaryWeaponOn() == true)
{
switch (gameManager.GetComponent<GameManager>().secondarySelected)
{
case "m1911a":
playerShooter.Shoot(0.15f);
break;
case "makarov":
playerShooter.Shoot(0.1f);
break;
case "pm40":
playerShooter.Shoot(0.21f);
break;
}
}
}
}
Every variable is getting changed I checked it so it all should be good. I changed the code only in this class and the function is checking the variables in other classes which is another reason this should be working as I did not change anything in other classes. Some time ago this was working and now something happened.