I am already shooting a forward raycast (indicated by blue in following picture) , but I also want to shoot a raycast angles slightly to the left and right from the transform.forward. I want to do this through script instead of creating child transforms and using those transforms’ forward. How would I implement this? Here is a picture to show what I mean:
Set the direction of your raycast to be Quaternion.AngleAxis(transform.up, offsetAngle) * transform.forward
for whatever value of offsetAngle
assuming your transform’s upward direction is pointing out of the screen.