By returning a TArray we may end up copying the array needlessly. To improve performance, we should change the signature of RemoveHits to take in a TArray reference and populate it inside the function:
void RemoveHits(const FMassEntityHandle& Entity, TArray<FMassProjectileHitResult>& OutHits);
By returning a TArray we may end up copying the array needlessly. To improve performance, we should change the signature of RemoveHits to take in a TArray reference and populate it inside the function:
void RemoveHits(const FMassEntityHandle& Entity, TArray<FMassProjectileHitResult>& OutHits);