RealDocs

UBlueprintSetLibrary::Set_Union

function Engine Blueprint Since unknown
#include "Kismet/BlueprintSetLibrary.h"
Access: public Specifiers: staticBlueprintCallableCustomThunk

Description

Assigns Result to the union of Set A and Set B — every element in A plus every element in B, with duplicates collapsed since a set only stores unique values.

Caveats & Gotchas

  • Elements present in both A and B are naturally deduplicated in Result, since TSet never stores two equal elements.
  • Result is written in place — use a separate set variable for it rather than reusing A or B as the output.

Signature

static void Set_Union(const TSet<int32>& A, const TSet<int32>& B, TSet<int32>& Result);

Parameters

Name Type Description Default
A const TSet<int32>& Wildcard placeholder for one set to union.
B const TSet<int32>& Wildcard placeholder for the other set to union.
Result TSet<int32>& Wildcard output set that receives every element from A and B combined.

Return Type

void

Example

Union two sets C++
TSet<int32> A = {1, 2, 3};
TSet<int32> B = {2, 3, 4};
TSet<int32> Result = A.Union(B); // {1, 2, 3, 4}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.