UAssetManager::GetIfInitialized
#include "Engine/AssetManager.h"
Access: public
Specifiers: static
Description
Returns the current AssetManager singleton if it has already been constructed, or nullptr otherwise. Safer than Get() when you're not certain initialization has happened yet.
Caveats & Gotchas
- • Returns nullptr instead of asserting, unlike Get() — always null-check the result before use.
- • Still returns the base UAssetManager* unless the project has configured a game-specific subclass via AssetManagerClassName.
Signature
static UAssetManager* GetIfInitialized(); Return Type
UAssetManager* Example
Null-safe access during early startup C++
if (UAssetManager* AssetManager = UAssetManager::GetIfInitialized())
{
AssetManager->LoadPrimaryAsset(FPrimaryAssetId("Weapon", "Rifle"));
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?