RealDocs

AGameStateBase::AsyncPackageLoaded

function Engine Since 4.14
#include "GameFramework/GameStateBase.h"
Access: public Specifiers: virtual

Description

Called by the engine when an async package load completes. Override in a subclass to let the game state react — for example, triggering a match state transition once a required asset has arrived.

Caveats & Gotchas

  • The base implementation is empty (`{}`); you must register interest in a package load yourself (via `LoadPackageAsync` or `FStreamableManager`) and then override this hook to receive the notification.
  • This fires on the game thread but there is no guarantee about frame timing relative to Tick — don't assume world state is fully settled when this callback runs.

Signature

virtual void AsyncPackageLoaded(UObject* Package)

Parameters

Name Type Description Default
Package UObject* The object (package) that finished loading asynchronously.

Return Type

void

Example

React to an async-loaded map overlay package C++
void AMyGameState::AsyncPackageLoaded(UObject* Package)
{
    Super::AsyncPackageLoaded(Package);
    if (Package && Package->GetName().Contains(TEXT("LevelOverlay")))
    {
        StartSpawningOverlayActors();
    }
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.