void Update() { if (currentequipment != null) { if (Input.GetButtonUp("Use EQP")) //if player uses EQP { if (currentitemscript.UseItem()) { GameObject placeditem = Instantiate(currentequipment, transform.position - new Vector3(0, 0.18f, 0), Quaternion.identity); } else { Debug.Log("Ran Out of Equip"); } } } }
private void Shoot() { if (endofAiming && shooting) { if (thegun.UseItem()) { shotsfired++; audioSource.PlayOneShot(gunsound, 1f); GameObject bullet = Instantiate(bulletprefab, bulletpos, Quaternion.identity); bullet.GetComponent <BulletScript>().velocity = aim * bulletSpeed; Destroy(bullet, 1f); } else { audioSource.PlayOneShot(emptygun, 1f); } } }