I’m working on a semi-seeking projectile that will fire straight ahead but if a targetable actor comes within a specified radius, it will set the actor as it’s target and switch to become a homing projectile.
I have everything working except I can’t figure out how to cast multiple traces at specific intervals around the character to cover that specific area. It’s likely some relatively simple vector math that i just don’t know yet (trying to learn) but any ideas or suggestions would be greatly appreciated.
Just for the record, I initially tried doing this with an overlap volume on the projectile but that resulted in that volume being part of the projectile so it just halted on the target at the overlap point rather than seeking it based on the internal collision volume.
I was able to resolve the failed trace issue by restarting the Editor and that is giving me exactly what I needed! Submit it as an answer so I can mark it
Not sure about the performance, probably depends on how many traces you want and how often.
Is this what you’re trying to achieve? Maybe I misunderstood you.
And yet another way in case obstructions need to be taken into account.
Rather than tracing x times all the time, sphere trace to check for obstructions only and only against the targets that fit the criteria - are in range:
start checking the distances between the projectile and targets after firing, immediately rejecting targets exceeding range
sphere trace against that list in order to reject obstructed targets
Now you have a list of targets that are both unobstructed and in range. Again, this keeps the tracing to minimum - you will never need more sphere traces than targets.
Not sure whether this is more efficient than any other suggested method. Probably irrelevant.