UKismetArrayLibrary::Array_Insert
#include "Kismet/KismetArrayLibrary.h"
Access: public
Specifiers: staticBlueprintCallableCustomThunk
Description
Inserts an item into an array at the given index, shifting later elements up by one.
Caveats & Gotchas
- • TargetArray is declared as TArray<int32> only as a wildcard placeholder — CustomThunk resolves the real element type at the call site via GenericArray_Insert, so it works for any Blueprint array type.
- • If Index is out of the array's current bounds, the engine logs a warning and clamps or no-ops rather than growing the array to fit — unlike Array_Set with bSizeToFit, there is no way to auto-expand.
- • Displayed in Blueprint as the 'Insert' node with CompactNodeTitle 'INSERT', not the C++ name Array_Insert.
Signature
static void Array_Insert(UPARAM(ref) TArray<int32>& TargetArray, const int32& NewItem, int32 Index); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TargetArray | UPARAM(ref) TArray<int32>& | The array to insert into. Passed by reference and mutated in place. | — |
| NewItem | const int32& | The item to insert into the array. | — |
| Index | int32 | The index at which to insert the item. | — |
Return Type
void Example
Insert at front C++
TArray<int32> Values = { 1, 2, 3 };
const int32 NewItem = 0;
UKismetArrayLibrary::Array_Insert(Values, NewItem, 0);
// Values is now { 0, 1, 2, 3 } See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?