Ejemplo n.º 1
0
    public void shoot()
    {
        RaycastHit hit;

        if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))
        {
            test.Play();
            Debug.Log(hit.transform.name);
            DestroyableObject ob = hit.transform.GetComponent <DestroyableObject>();

            if (ob != null)
            {
                ob.getHit(damage);
            }
        }
    }