I can select things to ignore, but this is impractical for my purposes. I really want to draw a line to object A and see if it hits object B on the way. I loop through this many times and A and B will change each time.
EDIT - i can’t use the ignore actors option - I really need to literally just perform a trace against ONE object, ignoring everything else in the game.
I don’t see how this can work with a line trace? I need to explicitly only check against an object. You can’t line trace against all objects with a tag only?
Get All Actors of Class > Get your specific actor from the array > save it as a variable > break hit result of trace > Branch to check if the actor is equal to your sacred one > profit
I found the easiest solution was to get all of the actors in an array, save it as a separate temporary variable and remove the current actor in the loop. Then I use that as the ignore actor list. Not super pretty but it works very well.
For my purposes this is fine but it doesn’t take into account level geometry so it’s not a perfect solution by any means.
Lol easy there. You can use a multi channel trace to get all objects along the trace. By breaking the hit result and checking for your specific actor, you can do whatever you need to do when it passes over it.
This is much more simple than your answer. Help us help you.
To clarify more so you don’t get frustrated, this will return your actor no matter what, as long as any part of the trace goes over it, and the trace will not stop when hitting anything else
First Go to Project Settings > Collision then create a New Object Channel name it what you want.
Next select object(s) you want to hit with the line trace, go to Collision > Collision presents and change to (custom) then under Object Type select the one you just created.
Finally create a LineTraceForObjects then drag out Object Types to create a custom variable and select the one you created.
Old post, but this is exactly what I needed. I though multi trace would send out multiple lines like a box trace, hitting the first thing it encounters. It actually gives you all hits along a line instead of stopping. Thanks!