LoadPackageAsync

Asynchronously load a package and all contained objects that match context flags.

Windows
MacOS
Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h

Include

#include "UObject/UObjectGlobals.h"

Source

/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncPackageLoader.cpp

Syntax

int32 LoadPackageAsync
(
    const FString & InName,
    const FGuid * InGuid,
    const TCHAR * InPackageToLoadFrom,
    FLoadPackageAsyncDelegate InCompletionDelegate,
    EPackageFlags InPackageFlags,
    int32 InPIEInstanceID,
    TAsyncLoadPriority InPackagePriority,
    const FLinkerInstancingContext * InstancingContext
)

Remarks

Asynchronously load a package and all contained objects that match context flags. Non-blocking. This version is useful when loading multiple copies of the same package.

Returns

Unique ID associated with this load request (the same package can be associated with multiple IDs).

Parameters

Parameter

Description

InName

Name of package to load

InGuid

GUID of the package to load, or nullptr for "don't care"

InPackageToLoadFrom

If non-null, this is another package name. We load from this package name, into a (probably new) package named InName

InCompletionDelegate

Delegate to be invoked when the packages has finished streaming

InPackageFlags

Package flags used to construct loaded package in memory

InPIEInstanceID

Play in Editor instance ID

InPackagePriority

Loading priority

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss