I cast a line trace from my camera every frame to hit actors, and i want to make sure that on the next frame i can have captured anything between the new line trace position and the line trace position on the previous frame. The effect I’m after is like a sweep to make sure nothing is uncaught between frames.
Save a variable one frame and read it the next.
I don’t understand. How can I check the distance in between?
when you run the first line-trace capture the points on either end, so you can read them the next trace.
You can use distance or vector length between any of the points to calc lines/distance as you need.
Thank you I think that makes sense, but if I’m in first person and casting a line trace from the camera then the distance of actors i’m tracing for could be at any distance away from the camera, so tracing between the different cast points would not guarantee capturing those in between actors at any distance, right?
Store the first trace hit location to a variable(it’s the last frame hit location),fire another line trace,starts from first trace hit location to the location you stored.
But what if the actor in between those two places is not on a direct trajectory between them since they’re not all at equal distance away from the start of the line traces (first person camera)
I don’t know,but I would give you some info how they make melee combat game.
They have multiple line traces from last frame to current frame like this.i don’t have real experience though.
you could see if you could pick some ideas from it ,modify a little and take to the project

With regards to the line-traces, what are you ultimately trying to do? There might be free(ish) things that already do this better, and quicker, than you or I.
eg: https://www.unrealengine.com/marketplace/en-US/product/rama-s-melee-weapon-plugin
First pass for me would be something like:
- take line from this trace and previous trace
- calculate a quad or box out of both lines
- whatever the quad intersects was hit
Thank you, yes I had considered some sort of box or converting world space to screen space maybe, but i’m not learned how to do either yet.
thank you for the effort!