RealDocs

UBlueprintMapLibrary::Map_Keys

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

Description

Outputs an array containing a copy of every key in the map. Order matches the map's internal iteration order, not insertion order.

Caveats & Gotchas

  • The output array is a snapshot — mutating the map afterwards does not update the Keys array you already retrieved.
  • TMap iteration order is not guaranteed to match insertion order and can shift after removals, since the underlying sparse array may reuse freed slots.

Signature

static void Map_Keys(const TMap<int32, int32>& TargetMap, TArray<int32>& Keys);

Parameters

Name Type Description Default
TargetMap const TMap<int32, int32>& Wildcard placeholder for the map to read keys from.
Keys TArray<int32>& Output array populated with a copy of every key currently in the map.

Return Type

void

Example

Collect all keys C++
TMap<FName, int32> Scores;
Scores.Add(TEXT("Player1"), 100);
Scores.Add(TEXT("Player2"), 75);

TArray<FName> AllKeys;
Scores.GetKeys(AllKeys); // native TMap::GetKeys — the direct equivalent of the Map_Keys node

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.