- Home /
How do I measure how far from the normal a raycast is when hitting a surface?
What I need to do is get a value, preferably a float, that tells me how far from the normal of a surface the raycast is hitting, that is, with the normal (90°) being the minimum and 180° the maximum.
I've seen a few things on Vector3.Angle and hit.normal, but I failed to understand it, or understand how to implement it.
Thanks in advance.
I don't quite understand. every point you hit on a surface is an origin for a normal that is usually interpolated between the three vertices that make the triangle you raycasted against. and every normal is normalized so the distance of the tip of the normal to the point you hit is always one. other than that I could only think of you mean the angle between normal and view vector
Your answer
Follow this Question
Related Questions
Using Raycast Normal to match surface rotation to instantiated gameobject? EXAMPLE GIF Included 0 Answers
Raycast hits and then doesn't fire again? 2D Game Raycasting Problem 1 Answer
Problem With Raycasthit Angle 0 Answers
Obstacle avoidance 1 Answer
How do I have the object disappear once the FPS controller looks at and then looks away. 0 Answers