MultiBoxTraceForObjects sometimes returns the same HISM instance twice

When performing MultiBoxTraceForObjects with HISM, if there is a hit result with one instance, it sometimes returns an array of two results, with each result containing the same instance id.

This is a regression against 4.16.3, where the result is a single instance. The same instance should not be returned twice.

Edit: This issue occurs in 4.18 Preview 3. I did not test 4.17.

Hey lotodore-

I tried adding a HISM component with one instance to a blueprint, and when I preformed a MultiBoxTraceForObject call I only ever got single hit back. Please let me know what your setup is like to help test this behavior locally.

I tried to reproduce this in a small project for several hours without success. So it is probably a bug in my code which simply came alive through testing with the new Unreal Engine release. Sorry for the noise.

Just in case someone stumbles across this post through the search function: I found the cause of this issue and it was indeed a bug in my code. It seems that by design MultiBoxTraceForObjects can return the same HISM instance multiple times if the HISM has several collision primitives. This is not mentioned in the trace documentation but I suppose it is consistent with other collision interactions. I dynamically activate/deactivate these collision primitives and if two of them are active for a HISM, it will return the same instance twice. I could finally reproduce the same behaviour in 4.16.3, timing was a bit different there. I fixed it by checking for duplicates after MultiBoxTraceForObjects.