I am having a mind boggling time trying to figure how to rotate a raycast with a Characters (GameObject) field of view. For example I am trying to make it so when the player comes into view of the enemies vision the enemy becomes alerted and chases after the player. I have everything setup right except for the Raycast, it can only be set to a vector3 'direction' and not the characters 'rotation' that I know of. Is this even possible? Or am I needing to do it a different way, any help would be much appreciated.
P.S
I am also trying to make it so the enemies field of view is set to a certain distance (Obviously) I have set a variable that stores the distance that I want, so far the player is not spotted until he enters the max range but the enemy will continue to follow him indefinitely regardless if he is out of range or not.
Thank