Added Round and Respawnsystem

This commit is contained in:
juliuse98
2021-11-19 14:42:09 +01:00
parent 7299b292a7
commit ad238ac417
27 changed files with 1451 additions and 188 deletions

View File

@@ -46,7 +46,6 @@ public class Shoot : NetworkBehaviour
}
if (Input.GetButtonDown("Fire")) {
updateCanvas = true;
Debug.Log(" click");
if (weapon.AllowAction)
{
shootAnim.Recoil(0.1f);
@@ -86,7 +85,6 @@ public class Shoot : NetworkBehaviour
if (Physics.Raycast(muzzle.transform.position, muzzle.transform.forward, out hit) && weapon.CurrentAmmunition > 0) { // Raycast from Bullet Exit Point to camera raycast
bulletHole(GameObject.CreatePrimitive(PrimitiveType.Sphere), hit); // Creates bullethole where raycast hits
if (hit.transform.gameObject.GetComponent<Player>() != null) { // If hit object is a player
Debug.Log("-->HIT PLAYER: " + hit.transform.name);
hit.transform.gameObject.GetComponent<Player>().RemoveHealth(weapon.Damage);
}
}