Multi Sphere Trace hitting the same enemy multiple times despite adding unique

  • Adjust Collision Settings: Configure the collision settings so that only specific components are detectable by the trace. For instance, set the mesh components to “NoCollision” and ensure that only the capsule component has the desired collision settings. This method reduces redundant hits by limiting the trace to essential components.

Epic Developer Community Forums

  • Filter Unique Actors: After performing the trace, iterate through the hit results and add each actor to an array using the AddUnique function. This ensures that each actor is processed only once, even if multiple components were hit.

Epic Developer Community Forums

  • Create Custom Collision Channels: Define a new object channel in the project settings and assign it exclusively to the primary component of your actors (e.g., the capsule component). Then, perform the trace against this custom channel, which helps in detecting only the intended components and avoids multiple hits from the same actor