void Shoot() { RaycastHit hit; if (Physics.Raycast(FPSCamera.transform.position, FPSCamera.transform.forward, out hit, range)) { Debug.Log(hit.transform.name); Target target = hit.transform.GetComponent <Target>(); if (target != null) { target.Active(); } } }