UBlueprintMapLibrary::Map_Contains
#include "Kismet/BlueprintMapLibrary.h"
Access: public
Specifiers: staticBlueprintPureCustomThunk
Description
Checks whether a key is present in a map without retrieving its value. Use Map_Find instead if you also need the value associated with the key.
Caveats & Gotchas
- • Pure node with no exec pins — calling it in a loop re-evaluates the lookup every time rather than caching the result.
- • Backs the Blueprint 'Contains' node; in C++ prefer TMap::Contains() or TMap::Find() directly rather than this wildcard CustomThunk wrapper.
Signature
static bool Map_Contains(const TMap<int32, int32>& TargetMap, const int32& Key); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TargetMap | const TMap<int32, int32>& | Wildcard placeholder for the map to search. CustomThunk resolves the real map type at the call site. | — |
| Key | const int32& | Wildcard key to look up. | — |
Return Type
bool Example
Check for a key before use C++
TMap<FName, int32> Scores;
Scores.Add(TEXT("Player1"), 100);
if (Scores.Contains(TEXT("Player1"))) // native TMap::Contains — the direct equivalent of the Map_Contains node
{
// safe to look up
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?