Fixed some issues.
Grenades work now.
This commit is contained in:
Noah4ever
2021-12-08 17:18:23 +01:00
parent 56f5aec9cc
commit 59a55bf5fd
4 changed files with 155 additions and 118 deletions

View File

@@ -79,6 +79,7 @@ public class Shoot : NetworkBehaviour
// Throws grenade with dropForce
weapon.HasBeenThrown = true;
weaponManager.dropWeapon(weapon.DropForce);
weaponManager.switchWeapon(1);
}
[Command]
@@ -138,6 +139,7 @@ public class Shoot : NetworkBehaviour
}
public bool setWeapon(GameObject newWeapon) {
Debug.Log("Switch weapon to: " + newWeapon.transform.name);
weapon = newWeapon.GetComponent<Weapon>();
curAmmo = weapon.CurrentAmmunition;
totalAmmo = weapon.TotalAmmunition;