Looking for the proper way to simulate blueprint’s BoxTaceByChannel “draw debug” functionality.
Never had to do this before because generally drawing a small sphere at the hit location is good enough. But that’s not really how the trace works…
DrawDebugBox can work, ofc, but do I really have to manually do the math for it?
The impact point of the trace can be anywhere within the box extent, so I have to dump the X/Y of the hit result and just use it’s Z to display the correct position.
It’s no big deal really, but because BP has it so much easier I think I have always just done this wrong?
The answer was in the thread I posted, but not in the message that appeared:
These functions are called UKismetSystemLibrary::CapsuleTraceMultiForObjects, UKismetSystemLibrary::SphereTraceSingle etc. There are different combinations. These include the debug and the input and and output matches the blueprint counterpart.
In this example call you also have how to declare an empty actor TArray and how to convert the trace channel type: