UKismetSystemLibrary::CancelTransaction
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticBlueprintCallable
Description
Cancels the current transaction and stops capturing actions into the undo buffer. Editor-only.
Caveats & Gotchas
- • You must pass the exact Index value returned by the matching BeginTransaction call — passing the wrong index can cancel more or less of the undo history than intended.
- • Cancelling does not undo actions already performed since BeginTransaction; it only stops further recording and discards the pending transaction entry.
- • Only available in the editor.
Signature
static void CancelTransaction(const int32 Index) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Index | int32 | The action counter to cancel transactions from, as returned by BeginTransaction. | — |
Return Type
void Example
Abort a transaction if a scripted edit fails partway through C++
int32 TransactionIndex = UKismetSystemLibrary::BeginTransaction(TEXT("MyEditorTool"), FText::FromString(TEXT("Batch Edit")), nullptr);
if (!TryApplyEdits())
{
UKismetSystemLibrary::CancelTransaction(TransactionIndex);
}
else
{
UKismetSystemLibrary::EndTransaction();
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?