I spent three days trying to get a RaycastCommand (Unity's jobified raycasts) working to get multiple hits per raycast. Should have been easy, according to the docs:
The result for a command at index N in the command buffer will be stored at index N * maxHits in the results buffer.
If maxHits is larger than the actual number of results for the command the result buffer will contain some invalid results which did not hit anything. The first invalid result is identified by the collider being null
maxHits The maximum number of Colliders the ray can hit
Well, no. I was getting super weird results and couldn't get it to work properly. First thing I checked was if I'm getting two+ hits for any of the raycasts, because you simply can't trust Unity. And I was getting multi hits, but seemingly at random.
The error? I was sorting the hits by distance using bubblesort, and made a simple error with index in it. Which resulted in me seemingly getting two hits per ray sometimes, but it was just a result for another ray moved there by faulty bubblesort. Because unity actually doesn't support multiple hits per ray.
I couldn't find the original thread about the issue (which was two years old by the time I was dealing with it), which had an amazing reply from Unity:
I have discussed it with an engineering team, and RaycastCommands don't support multiple hits because it was difficult to implement. The documentation just doesn't explains it really well
The fuck doesn't explain it very well??? It literally describes a parameter that sets max hits per ray and tells you how to get the multi hits from results...
Fuck unity :D
How are they controlled? If it's radio, shouldn't it be pretty easy to jamm, assuming you have the means to?
If I'm not mistaken the main weakness of FPV drones is that you have to manually control it untill it's directly at or above the enemy. Which most of other weapons don't need, and you can fire them from slightly larger distance.
But, since we are talking russia here, it works amazingly well.
On an unrelated note, if any of you haven't seen FPV drone racing, it's one one of the most cyberpunk and coolest sports.