Creating A Melee System With Traces Or Collision

One problem with the second approach is that if you swing the sword fast enough, in one frame it will be in front of an object and the next frame it will be past it. So no collision will ever be registered. This is why the first approach is gaining popularity. As I understand it, you don’t use the forward vector to project where the line trace goes. In each frame you create a trace between the current position of a socket on the sword and the socket’s position in the previous frame. So in frame t, if the sword went past the object, the object will still intersect with the straight line between the socket’s position in frame t and t-1. Given that point of intersection and the vector direction of that straight line, you can apply a force,impulse, damage … etc. to the object.