hey, i want to make a raycast that starts from the camera and goes to in ther direction the camera is looking at, i am a little new to raycasting so here is what i have:
function Update () {
var hit : RaycastHit;
if (Physics.Raycast(transform.position, /*idk what to put here*/, hit, distance)){
target = hit.transform;
}
else{
target = null;
}
}
and if you just need to find the camera from any script, you can use
– LoiusCamera.main.transform.forward