Starting on this week's focus combat with melee hit detection. Creating a sword with a line acting as the damage dealing section. Raycast based hit detection script for it.
I created a script that distributes given amount of points on a line constructed of empties. In the video the "detection points" are drawn as spheres on the sword.
Spheres in the picture visualize the line's points.
The position of the "detection points" are saved for the next frame. Then a raycast is shot towards the last frames position, detecting a possible hit. In the video the red rays mean no hit and green ones mean hit.