UBlueprintMapLibrary::Map_Add
#include "Kismet/BlueprintMapLibrary.h"
Access: public
Specifiers: staticBlueprintCallableCustomThunk
Description
Adds a key/value pair to a map, overwriting any existing value already stored under that key.
Caveats & Gotchas
- • TargetMap, Key, and Value are declared with placeholder int32 types only because this is a CustomThunk wildcard node — GenericMap_Add resolves the real map/key/value types from the Blueprint VM stack at the call site, so this works for any Blueprint map type.
- • In C++, call TMap::Add() directly instead — this function exists to back the Blueprint 'Add' node, not for native map manipulation, and incurs reflection overhead that direct TMap access avoids.
Signature
static void Map_Add(const TMap<int32, int32>& TargetMap, const int32& Key, const int32& Value); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TargetMap | const TMap<int32, int32>& | The map to add the key and value to. Wildcard placeholder — CustomThunk resolves the real map type at the call site. Mutated in place. | — |
| Key | const int32& | Wildcard key to insert or overwrite. | — |
| Value | const int32& | Wildcard value to associate with Key. | — |
Return Type
void Example
Add or overwrite a map entry C++
TMap<FName, int32> Scores;
Scores.Add(TEXT("Player1"), 100); // native TMap::Add — the direct C++ equivalent of the Map_Add Blueprint node Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?