UKismetArrayLibrary::Array_Clear
#include "Kismet/KismetArrayLibrary.h"
Access: public
Specifiers: staticBlueprintCallableCustomThunk
Description
Removes all elements from an array, leaving it empty.
Caveats & Gotchas
- • Registered with the Blueprint keyword 'empty', so searching 'empty' in the node palette surfaces this as the 'Clear' node.
- • Empties the array in place but does not shrink the underlying allocation — equivalent to TArray::Reset(), not Empty(), so repeated Clear/re-fill cycles avoid reallocation churn.
- • Calling this on an already-empty array is a safe no-op.
Signature
static void Array_Clear(UPARAM(ref) TArray<int32>& TargetArray); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TargetArray | UPARAM(ref) TArray<int32>& | The array to clear. Passed by reference and mutated in place. | — |
Return Type
void Example
Clear an array before refilling it C++
TArray<int32> Values = { 1, 2, 3 };
UKismetArrayLibrary::Array_Clear(Values);
// Values is now empty, Values.Num() == 0 See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?