Line trace hit normal when tracing on edge

Isn’t that just the correct normal for the face the trace is hitting?
The edge itself can’t be hit by a trace yeah, it has no surface, so it either hits one face or the other. I’m not sure how Unreal determines which is hit in that case. But you’ll get the normal of one or the other. So some sort of averaging/smoothing would work.

You could do a moving average of the normals, or an average from multiple traces from very slightly offset locations, with the results averaged. This will be stable even if the character was stationary and happened to be in a position where the trace would be hitting exactly on an edge using the old method. That seems fairly unlikely to happen though. And also technically it could still pop between different values in some cases. So the moving average of normals should work, since the player will always be moving around, and unlikely to be lined up with an edge. Basically it will just smooth out the values a bit, at the cost of a slight lag getting the actual value, the more samples the more lag obviously.

The average function: (make sure Total is a local variable)