Some alternatives that could help:
- Try a cone shape collision to get overlapping actors in angle in front of player rather than multi trace. Removes the need to tick if managed on begin/end overlaps.
- Then trace each: tested tracing for static objects; if no hit then there is line of sight:
From the sort function of your other post Get closest hit to origin in a multi sphere trace? - #10 by Krileon :
- IMO might be better to just have 2 separate arrays over a map. Having 2 separate arrays allows to sort without duplicating. Then access closest from index 0->.
Haven’t really compared, just thought it was worth the debate.