Download

UV coords from Line Trace in C++ without Kismet LineTrace

Hi,

I need to get UVs from LineTrace hit. I’ve enabled the Line Trace hit UV support in the project settings. The feature seems to work fine in Blueprint and in C++ with Line Traces from Kismet library, but does not seem to work when using C++ line traces. I need to use ActorLineTraceSingle() specifically, and get UV coords from the hit. Kismet Line trace has quite a few issues.

Is there any way to get UV coords from the hit of non-Kismet library line trace?

Thank you in advance.

Aaaand as usually, rubberduck debugging works :slight_smile: Just a few minutes later, I have a solution. FCollisionQueryParams supplied to the line trace need to have following two properties set to true:



FCollisionQueryParams CollisionParams;
CollisionParams.bTraceComplex = true;
CollisionParams.bReturnFaceIndex = true;