Weapon Pickup start

+ started weapon pickup
This commit is contained in:
Noah4ever
2021-10-18 19:24:56 +02:00
parent 0c274a031f
commit 631938fa22
10 changed files with 10644 additions and 62 deletions

View File

@@ -20,6 +20,22 @@ public class Weapon : MonoBehaviour
private bool allowShoot = true, isShooting = false;
Animator anim;
/*
*
* + Weapon Pickup
* + Weapon Manage
* + Weapon Inventory
* + Weapon Drop
*
*
*/
private void Start()
{
anim = GetComponent<Animator>();
@@ -47,6 +63,21 @@ public class Weapon : MonoBehaviour
{
currentAmmunition = totalAmmunition;
}
if (Input.GetButton("Aim")) // Not working properly, maybe Animations are not correct to use
{
anim.Play("USP_Aim");
}
if (Input.GetButton("Interact"))
{
if(Physics.Raycast(camera.transform.position, camera.transform.forward, out RaycastHit hit))
{
Debug.DrawLine(camera.transform.position, hit.point);
if (hit.collider.transform.name == transform.name)
{
Debug.Log("Hit me!");
}
}
}
}
private void fire()