Download

Need recommendation on Advanced Collision methods

So I’m making a game with weapon combat. Its a networked game. Currently, I do my collision detection with Swept Sphere Traces. So I put multiple sockets on my weapon and do a SweepSingleByChannel with a sphere between last socket positions and current socket positions every Tick. If a hit is detected, I break out of the loop and return that HitResult. I drew a diagram below of what I mean (the first picture).

I have a new idea though that I think will be even better and less laggy in networked games. So along the weapon blade, I put a UCapsuleComponent that covers it. The weapon has 2 sockets, one at the blade tip and one near the handle. When my UCapsuleComponent detects a hit, then I do a sphere trace between the 2 sockets, get the HitResult and return it. It probably doesn’t even involve the tick function. It seems better and possibly more accurate and faster. The only issue is I don’t think there is a way to ignore certain pawns with the UCapsuleComponent (can’t ignore self). The second diagram is an image of my idea to understand it better.

What do you guys think is better? Should I stick with my first method or do the second method? Or if you have an even better idea, I’d be glad to hear it. The collision has to be accurate and not cause lag in networked environment (my game will have 4 people playing at once). I also need to get a FHitResult which you can’t do with ShapeComponents which is why I’m doing a trace (for impacts, particles, sounds, etc).