How to get multiple hit locations on same actor with trace at once?
Im trying to create a bullet penetration, but Im not having any luck with traces so far. As it stands, a trace only returns one hit location per actor, which means there is only an entrance location but no exit location. This makes it very hard to get the length of the vector between where the bullet would enter, and where it would exit to compute whether the bullet will or will not exit.
So, is there any way to have a trace get multiple hit locations on a single actor with a single line trace?
asked Feb 05 '16 at 10:38 PM in Blueprint Scripting
yes, you can do a second line trace that returns a second point. so for example in your first line trace, you have access hit location and hit normal i believe. if you build a new trace that starts at a point created from the original hit normal, following the same vector direction to some point behind the character, you can then build a new trace that starts from there and traces back toward the source of the first trace's start point. so if your original trace hit returns true, do a second trace hit from behind using the original trace data.
so just to recap/clarify, if your first trace hits, get your hit normal, multiply by negative 100 or something, and add that vector to your hit location. then use that number as a start location for your second trace, and use the original hit location from the first trace as the end location of the second trace.
Follow this question
Once you sign in you will be able to subscribe for any updates here