# Custom Assets not being loaded into Memory

**URL:** <https://forums.unrealengine.com/t/custom-assets-not-being-loaded-into-memory/771705>\
**Category:** C++\
**Tags:** references, asset-pointer, unreal-engine, memory, CPP, question\
**Created:** [February 15, 2023, 10:25pm UTC](https://forums.unrealengine.com/t/custom-assets-not-being-loaded-into-memory/771705 "2023-02-15T22:25:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foolish.Flower1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Foolish.Flower1](https://forums.unrealengine.com/u/Foolish.Flower1)\
**Post date:** [February 15, 2023, 10:25pm UTC](https://forums.unrealengine.com/t/custom-assets-not-being-loaded-into-memory/771705/1 "2023-02-15T22:25:32Z")

</div>

I have an asset that fails to correctly load to memory unless I open it in Editor. What’s strange is that is passes tests to check whether or not it has been loaded, but does not work accordingly (no crash occurs, but it returns wrong information)

I have an **TSoftObjectPtr** to the asset.

I already tried out what’s been suggested on these threads:  
([this](https://forums.unrealengine.com/t/assets-not-loading-from-the-assetregistry/88686) and [this](https://forums.unrealengine.com/t/asset-not-found-in-assetregistry-until-i-open-it-in-editor/304034), )

I also tried some different approaches:

**Load Synchronous**

```auto
UMyObject* MyObject = MyObjectSoftPtr.LoadSynchronous();

```

**Streamable Manager**

```auto
FStreamableManager& Streamable = UAssetManager::GetStreamableManager();

const FSoftObjectPath& AssetRef = MyObjectSoftPtr.ToSoftObjectPath();
MyObjectSoftPtr= Cast<UMyObject>(Streamable.LoadSynchronous(AssetRef ));

UMyObject* MyObject = MyObjectSoftPtr.Get();

```

**Asset Registry**

```auto
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
FAssetData MyObjectAsset = AssetRegistry.GetAssetByObjectPath(*MyObjectSoftPtr.ToString());

UMyObject* MyObject = Cast<UMyObject>(MyObjectAsset .GetAsset());

```

It also passes tests such as:

```auto
if(MyObject)

```

or

```auto
if(MyObjectAsset.IsAssetLoaded())

```

But when I need the actual functionality of the asset, the code runs (prints in it do show), but does not return the expected results until I open the asset in the Editor.

Anyone got any clues?

---

<div class="post-metadata">

**Author:** ![cowji](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cowji](https://forums.unrealengine.com/u/cowji)\
**Post date:** [August 16, 2023, 5:57am UTC](https://forums.unrealengine.com/t/custom-assets-not-being-loaded-into-memory/771705/2 "2023-08-16T05:57:18Z")

</div>

Get same Problem
