- Home /
Other
Angle between Ray and Normal
I am shooting a ray at the ground at Vector3(0,-1, .1743) roughly at -5 degrees from down. Then I am getting the normal of what it hits. Next I want to get the angle between the ray and the normal. The ground is flat so When I use `Vector3.AngleBetween(hit.point (or Vector3(0,-1, .1743)), hit.normal);` It should give me 5 right? Well no for some reason it gives me anything but. Am I using Angle wrong, is there a better way to do this?
Answer by ScroodgeM · Aug 29, 2012 at 09:25 PM
use .Angle()
http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Angle.html
AngleBetween is deprecated
I had tried .Angle() before and it didn't do any better. But thank you anyways I was woundering what the difference between the two was.
AngleBetween (old version) returns angle in radians, Angle in degrees
Follow this Question
Related Questions
Raycasting at an offset angle? 4 Answers
Why does the raycast hit only objects/faces of a certain rotation? 1 Answer
Problem With Raycasthit Angle 0 Answers
Average of Normals 1 Answer
raycast and trigonometry 2 Answers