Hi all,
I thought the box trace would always take the closest actor, am I wrong?
Target switching works when the box trace is small enough so only 1 actor is in it, but I want it to be bigger and take the closest actor, but that is not working, is there a way to fix this?
You’re not really tracing in a direction - we’re not giving the trace a chance to do what it’s supposed to since the start and end are the same.
This just plops a giant box and grabs whatever happens to be inside. If there are multiple actors, we have a problem. You might as well get overlapping actors instead. If you overlap more than one actor, you get the 1st one - not necessarily the closest one.
If there is a chance the volume trace will hit more than 1 target in the same frame, you may need another approach.
if tracing - use multibox trace, get all hit actors and sort by distance:
pff, did not know there was a node like that. Using my own libraries for so long that I forget to check what’s new. Sorry for sending you on a chase about sorting. At least we both learnt something.