I’m having a problem with line trace. If I use “Get Hit Result Under Cursor for Objects” the face index is not working, it always returns -1. If I use “Line Trace by Channel” tracing the same spot, same object, I get a proper face index, example 7.
It’s pretty easy to reproduce on any sample level. Do you know why the face index is not working?
Side note, I tried to investigate the C++ code behind that BP.
As you see in the last line he is passing some hardcoded parameters, then later in the code it seems to check for a FCollisionQueryParams.bReturnFaceIndex
At the moment I decided to do it differntly, and here is what I use and works ok. Still my question above stands, on why it returns -1 and there is no way to change it.
I recently encountered the same issue and found that there’s a boolean “bReturnFaceIndex” in FCollisionQueryParams. For the normal LineTrace function you can pass in a custom FCollisionQueryParams, where you can set bReturnFaceIndex to true. However, GetHitResultUnderCursor() doesn’t allow you to pass in custom collision params. I basically dug through the engine code and rewrite the function implementation to support passing in collision params. Hope this might help someone.