Weapon Switching/Pickup/Throwing

+ weapon switching works
+ weapon pickup works
+ weapon throwing works

ntba weapon in correct position
ntba weapon switch/pickup/throw animation
This commit is contained in:
Noah4ever
2021-11-21 18:00:23 +01:00
parent a40aec3874
commit c4eac172fe
4 changed files with 59 additions and 50 deletions

View File

@@ -44,9 +44,12 @@ public class Shoot : NetworkBehaviour
totalAmmo = weapon.TotalAmmunition;
updateCanvas = false;
}
if (Input.GetButtonDown("Fire")) { // BOX COLLIDER AUS
if (Input.GetButtonDown("Fire")) {
updateCanvas = true;
Debug.Log(" click");
if(weapon.GetComponent<BoxCollider>().enabled == true) // NACH ANDERE L<>SUNG SUCHEN
{
weapon.GetComponent<BoxCollider>().enabled = false;
}
if (weapon.AllowAction && weapon.CurrentAmmunition > 0)
{
shootAnim.Recoil(0.1f);
@@ -97,7 +100,7 @@ public class Shoot : NetworkBehaviour
}
}
void bulletHole(GameObject holeObject, RaycastHit hit)
void bulletHole(GameObject holeObject, RaycastHit hit) // Nur zum testen da
{
holeObject.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
holeObject.transform.position = hit.point;