UnrealSharp
  • Home
  • FAQ
  • Getting Started
    • Setup
    • Your First Script
    • Debugging
    • Packaging
  • Documentation
    • Classes
      • Properties
        • C++ Functions As C# Properties
        • C++ Properties with Getters/Setters
      • Functions
        • Flags
        • MetaData
      • Default Actor Components
      • Helper Methods
    • Structs
    • Enums
    • Interfaces
    • Delegates
    • Collections
      • TArray
      • TNativeArray
      • TSet
      • TMap
    • Multiplayer
      • Replicated Properties
      • RPCs (Remote Procedure Calls)
      • Replicated UObjects
    • Primary Data Assets
      • Loading Primary Data Assets
    • Loading Soft References
    • Trace Channels
    • Static Variables
      • FWorldStaticVar<T>
      • FGameStaticVar<T>
    • Logging
    • Async
    • Gameplay Tags
      • Gameplay Tag Container
    • Extension / Mixin Methods
    • Subsystems
    • Module Lifecycle
  • Links
    • Github Repository
    • Roadmap
    • Discord
Powered by GitBook
On this page
  1. Documentation

Loading Soft References

Unreal has two ways to reference assets so they're not a hard reference. Both through TSoftObjectPtr<T> and TSoftClassPtr<T>, these must be loaded in order to use them.

Async Loading

This API allows you to load soft references asynchronously.

  • If the reference is null, an exception is thrown.

  • If the asset is already loaded, it's returned immediately.

  • Otherwise, the asset is loaded in the background and returned once ready.

Load a single soft reference:

var loadedReferences = await softReference.LoadAsync();

Load a list of soft references:

var loadedReferences = await softReferences.LoadAsync();

PreviousLoading Primary Data AssetsNextTrace Channels

Last updated 1 month ago