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

        if (Physics.Raycast(bulletPoint.transform.position, bulletPoint.transform.forward, out hit, range)) //(position of bullet point,forward from bullet point position, shoot, within certain range)
        {
            Debug.Log(hit.transform.name);


            ChangeMaterial changeMaterial = hit.transform.GetComponent <ChangeMaterial>();


            if (changeMaterial != null)
            {
                changeMaterial.ColourBlue();
            }
        }
    }