RealDocs

FStreamableManager

struct Engine Since 4.0
#include "Engine/StreamableManager.h"

Description

Manages asynchronous and synchronous loading of soft-referenced UObject assets. Holds loaded assets in memory until the returned FStreamableHandle is released.

Signature

struct FStreamableManager : public FGCObject

Caveats & Gotchas

  • You must keep the FStreamableHandle alive (store it as TSharedPtr) for as long as you want the loaded assets to remain in memory. Releasing the handle allows GC to collect them.
  • Do not create your own FStreamableManager in most cases — use UAssetManager::GetStreamableManager() to access the global singleton.
  • LoadSynchronous can stall the game thread for multiple seconds. Use RequestAsyncLoad with a delegate instead for runtime loading.
  • The delegate passed to RequestAsyncLoad fires on the next tick if the asset is already loaded, or later if it must be streamed in.

Example

Async load a soft object reference C++
// In your class header:
TSharedPtr<FStreamableHandle> LoadHandle;

// In code:
FStreamableManager& Manager = UAssetManager::GetStreamableManager();
LoadHandle = Manager.RequestAsyncLoad(
    SoftMeshRef.ToSoftObjectPath(),
    FStreamableDelegate::CreateUObject(this, &AMyActor::OnMeshLoaded)
);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.