UGameplayStatics::CancelAsyncLoading
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Cancels all currently queued asynchronous package loading requests. Used before a hard level transition to clear the async load queue and prevent stale loads from completing into the new world.
Caveats & Gotchas
- • Cancellation is best-effort: packages that have already been fully read from disk may still complete loading even after this call. The cancel prevents new decompression and processing but cannot abort I/O already in flight.
- • Any callbacks registered via LoadPackageAsync or similar APIs for the cancelled requests may never fire, or may fire with a failed status. Always guard callbacks against this.
- • Calling this does not flush streaming levels managed by ULevelStreaming — use FlushLevelStreaming for that. CancelAsyncLoading targets the lower-level async package loader.
Signature
static ENGINE_API void CancelAsyncLoading(); Return Type
void Example
Clear async load queue before travelling to a new level C++
// Cancel any background asset loads before the hard travel
UGameplayStatics::CancelAsyncLoading();
UGameplayStatics::OpenLevel(this, FName("MainMenu")); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?