Example #1
0
    void Shotgun()
    {
        aud2.Play();
        Debug.Log("boom shotty");
        RaycastHit hit;

        if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, range))
        {
            Debug.Log(hit.transform.name);
            Targetball target = hit.transform.GetComponent <Targetball>();
            if (target != null)
            {
                Debug.Log("target is live");
                target.TakeDamage(ShotgunDamage);
                Score.score += ShotgunDamage;
            }
        }
    }
Example #2
0
    void Shoot()
    {
        RaycastHit hit;

        if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, range))
        {
            Debug.Log(hit.transform.name);
            Targetball target = hit.transform.GetComponent <Targetball>();
            // Scorekeeper score = hit.transform.GetComponent<Scorekeeper>();

            if (target != null)
            {
                Debug.Log("target is live");
                target.TakeDamage(AkDamage);
                Score.score += AkDamage;
                // score.IncreaseScore(AKDamage);
            }
        }
        // Debug.Log("aking");
        aud.Play();
        // ani.Play("Recoil");
    }