Hello I posted this to unity answers as well, but I thought I would try here as well. I am making a game and when I cast rays they only shoot a specific distance, not the one I told them too and I have no idea why, has anyone else had this problem?
-thanks
if (Input.GetMouseButton(0) || Input.GetKeyDown(KeyCode.E)) {
RaycastHit hit;
if(Physics.Raycast(muzzle.transform.position, muzzle.transform.forward, out hit, 100.0f)){
if (hit.transform.tag == "Enemy") {
hit.transform.gameObject.GetComponent<Enemyscript>().health -= 10;
}