mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-10-29 20:52:10 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user