No announcement yet.

Melee Weapon Tracing - Vector Issues

  • Filter
  • Time
  • Show
Clear All
new posts

    Melee Weapon Tracing - Vector Issues

    Apologies if this has a really simple and obvious solution. I'm learning vector maths but it ain't easy.

    My goal is to create a system that traces through the player’s melee weapon while they attack. It also runs tracers across more or less perpendicular to the straight trace. This is the technique used in the game Chivalry, as you can see here:

    The first section of the blueprint runs a trace from one bone in the weapon to another. This works fine, as you can see in the screenshot.

    The second section takes care of some variables, which will make sense after the next section.

    The third section is where the problem lies. It begins tracing segments from where the original trace began, but only goes 1/10th of the distance. The next segment then starts from the end point of the last segment, and so on. This is repeated 10 times. Now we have 10 segment traces, which should perfectly overlap with the first trace.

    As you can see, they point in a completely different direction. I have no idea how to get them to pointing in the right direction.

    The fourth section takes the start locations of those previous 10 segment traces, and then traces to the last frame's segment start locations. This creates tracers that look like a spider's web and make for better hitreg (blue in the screenshot). These work totally fine, as you can see.

    The final section just clears arrays and shifts this frames segment tracer end locations into another array so they can be used next frame.

    So, if anyone has a better understanding of vector maths than me (not hard), what is the best way to align those segment tracers with the initial trace through the weapon?
    Attached Files