How to get the SURFACE normal from line trace hit location?

Hey guys.

So I’m trying to get the vector perpendicular to the surface of any object hit by a line trace. I don’t want the impact normal, instead, I always want the result to be a right angle from the surface of the wall. As in the attached pic, how can I modify the line trace hit result so that I’m generating the vector of the white line?

As always, thank you!!!

Sorry if I misinterpret the question.

To get a vector perpendicular to the surface (the normal) of a hit object, you just have to add the impact normal to the impact point. As far as I understand the reason why is because the impact normal is a direction vector, so it could describe any number of parallel surfaces.

Below I make a little blueprint showing how using the hit result of an initial trace, a second trace can be done parallel to the normal at the impact position.

The result:

Hope this helps.

5 Likes

Hey Sandstrike,

Thanks for the solution. I should have updated this a couple weeks ago when I finally sorted out the problem but this is helpful for others who might have the same confusion.

You are 100% correct. My error was ultimately related to two things… a misunderstanding of what the impact normal actually is and a rotator that wasn’t working as I intended. I thought the impact normal vector result depended on the angle of the line trace it came from but, as you say, it doesn’t. It will always be orthogonal to the surface it hits, no matter how it hits it.

Thanks!
SVR33

1 Like