UKismetArrayLibrary::Array_Get
#include "Kismet/KismetArrayLibrary.h"
Access: public
Specifiers: staticBlueprintPureCustomThunk
Description
Returns a copy of the array element at the given index via an output parameter.
Caveats & Gotchas
- • Marked BlueprintInternalUseOnly, so it doesn't appear directly in the node palette — Blueprint's 'Get (a copy)' array node and the array-index [ ] pin both compile down to this function.
- • An out-of-range Index logs a runtime warning and leaves Item at its default-constructed value rather than crashing — always validate with Array_IsValidIndex first in C++ callers building on GenericArray_Get.
- • Returns a copy, not a reference — mutating Item afterward does not modify TargetArray.
Signature
static void Array_Get(const TArray<int32>& TargetArray, int32 Index, int32& Item); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TargetArray | const TArray<int32>& | The array to read from. | — |
| Index | int32 | The index of the element to copy out. | — |
| Item | int32& | Output parameter filled with a copy of the element at Index. | — |
Return Type
void Example
Read an element safely C++
TArray<int32> Values = { 10, 20, 30 };
if (UKismetArrayLibrary::Array_IsValidIndex(Values, 1))
{
int32 Item;
UKismetArrayLibrary::Array_Get(Values, 1, Item);
// Item == 20
} See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?