How to receive whether line trace hits backface or frontface?
i need to know whether a line trace hits a backface or a frontface (trace complex, mesh uses complex collision as simple and is double sided) but found no solution to the problem*. The only workaround i can think of at the moment would be to have two versions of the mesh, both not double sided and one with flipped normals. That would nearly double the meshes in the game :(
I would highly prefer a solution with blueprints, but if everything's falling apart i would be thankful about ideas or solutions involving c++, too shudder
first i thought impact normal and impact point would be helpful... but unfortunately they are what they say they are: impact normal and trace normal and not the normal of the hitten face
If you know the normal of the mesh your hitting then you can use a dot product check to determine if you are hitting the back side or the front side.
Do a dot product between the normal of the surface that you're hitting and the direction of the line trace. If the return value is less than 0 then you are hitting the front face and if its greater than zero then you are hitting the back face.
answered Mar 29 '18 at 01:28 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here