Grenade Fix

Grenade is now a Sphere.
set Commented the [Command] on CmdFireBullet in Shoot.cs to see how it is in multiplayer
This commit is contained in:
Noah4ever
2021-12-09 13:33:54 +01:00
parent 3a1a279530
commit e59b767daf
7 changed files with 342 additions and 588 deletions

View File

@@ -46,10 +46,7 @@ public class Shoot : NetworkBehaviour
}
if (Input.GetButtonDown("Fire")) {
updateCanvas = true;
if(weapon.GetComponent<BoxCollider>().enabled == true) // NACH ANDERE L<>SUNG SUCHEN
{
weapon.GetComponent<BoxCollider>().enabled = false;
}
// If current weapon kind is a rifle or pistole
string weaponKindString = weapon.WeaponKind.ToString();
if(weaponKindString == "Rifle" || weaponKindString == "Pistole") {
@@ -89,7 +86,7 @@ public class Shoot : NetworkBehaviour
}
}
[Command]
// [Command]
// This code will be executed on the Server.
private void CmdFireBullet() {
ray = new Ray(mCamera.transform.position, mCamera.transform.forward); // Raycast from Camera