Problem is not reproducible or outdated
How to change ray angle of inclination
Hi Guys! I have a little problem. I want to do little bit more realistic shots. When i have a ray from main camera then shot is going in a straight line. I want to do ray angle but i dont know how. I tried with quaternions but i think this isn't good solution. Can you help me please?
PS. I dont want bend ray.
I guess you could ray the first one a certain distance and then continue from that position with a new angle. Was that what you had in $$anonymous$$d?
Answer by Filhanteraren · Nov 22, 2016 at 10:44 PM
Vector3 forward = this.transform.forward;
forward = Quaternion.AngleAxis(45, Vector3.up) * forward;
Use this as your forward Vector3 when doing the raycast.
Follow this Question
Related Questions
Raycast under crosshair 0 Answers
How to cast a Ray using local pivot of an object? 1 Answer
Raycast Performance 3 Answers
Raycast hit not working when GameObject is changed 0 Answers
How to reflect raycast rays of objects 2 Answers