RealDocs

TSoftObjectPtr::LoadSynchronous

function CoreUObject Since 4.17
#include "UObject/SoftObjectPtr.h"
Access: public Specifiers: const

Description

Synchronously loads the referenced asset if it is not already in memory and returns a typed T* pointer. Returns null if the pointer is null or if the loaded object cannot be cast to T.

Caveats & Gotchas

  • Blocks the calling thread until the asset is fully loaded — never call this from the game thread during gameplay without prior streaming or preloading, as it will cause frame hitches.
  • The function internally calls FSoftObjectPath::TryLoad, which can trigger a full package load, not just an object load — loading a single asset may pull in its entire package and all dependencies.
  • If the asset is already in memory, this is essentially free (a Get() + Cast<T>), making it safe to call speculatively when the asset is expected to be loaded.

Signature

T* LoadSynchronous() const

Return Type

T*

Example

Loading a data asset at startup C++
UPROPERTY(EditDefaultsOnly)
TSoftObjectPtr<UMyGameData> GameDataRef;

void AMyGameMode::BeginPlay()
{
    Super::BeginPlay();
    // Safe during BeginPlay if asset is small/preloaded
    if (UMyGameData* Data = GameDataRef.LoadSynchronous())
    {
        InitializeFromData(Data);
    }
}

Version History

Introduced in: 4.17

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.