# GetAssetsByClass Node not working in 5.1 ?

**URL:** <https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-1, Blueprint, question\
**Created:** [November 21, 2022, 4:09pm UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028 "2022-11-21T16:09:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabrielle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gabrielle](https://forums.unrealengine.com/u/gabrielle)\
**Post date:** [November 21, 2022, 4:09pm UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/1 "2022-11-21T16:09:45Z")

</div>

Hi everyone,

I’m currently working on migrating one of my projects from 5.0 to 5.1 and I’m stuck with blueprint node GetAssetsByClass (from asset registry)

In previous versions, I was using it by providing the class name. This input no longer exists and I have to provide ClassPathName which is ‘TopLevelAssetPath’ structure.

I’ve created one and filled the Package name field with a path such as ‘/Game/Path/to/my/class’ and Asset name field with the name of the class. I’ve tried various combinations : MyClassName only, MyClassName\_C (with was what I used with previous versions), MyClassName.MyClassName (from the copy reference item in the content browser). No luck so far, the node always returns an empty list.

I’ve also noticed in the debugger that there’s an additional dot before the className in the ClasspathName input of the node.

Could this be a bug with this node or am I doing something wrong with the package/class name here ?

Any help is appreciated.

Below is a caps of the former node vs the new node :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/5/a157e4a5df77c8555b9f70834c6be9f6347df359.png)

---

<div class="post-metadata">

**Author:** ![lilypaddin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lilypaddin](https://forums.unrealengine.com/u/lilypaddin)\
**Post date:** [November 23, 2022, 5:14am UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/2 "2022-11-23T05:14:05Z")

</div>

Not sure how to interact with the new blueprint node in 5.1, but you can call it properly in C++ pretty easily.

```auto
TArray<FAssetData> AssetDataList;
	TArray<AActor*> ActorAssets; 
	IAssetRegistry& AssetRegistry = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry")).Get();
	AssetRegistry.GetAssetsByClass(FTopLevelAssetPath(AActor::StaticClass()->GetPathName()), AssetDataList, true);

```

The change is that you now have to wrap the path of the class in an FTopLevelAssetPath struct.

---

<div class="post-metadata">

**Author:** ![hGosling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hGosling](https://forums.unrealengine.com/u/hGosling)\
**Post date:** [December 27, 2022, 8:48pm UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/3 "2022-12-27T20:48:48Z")

</div>

How to use the new blueprint node:

Copy class reference  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/7/ca7775bc7eddfd54feaadbbea08045fd3fea47f3.png)

/Script/CoreUObject.Class’ **/Script/HeadGame**.HGRiggedHair’

The bold part is Package Name

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/4/e44ba94ecaf54ea422d24835c63641ebf74e39bf.png)

---

<div class="post-metadata">

**Author:** ![hGosling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hGosling](https://forums.unrealengine.com/u/hGosling)\
**Post date:** [December 27, 2022, 9:15pm UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/4 "2022-12-27T21:15:53Z")

</div>

You can also get the class path doing this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/2/1d28f9b0e9ee2a2229c1c683f08cb990b783874b.png)

This way you could create your own wrapper function which just needs a class reference

---

<div class="post-metadata">

**Author:** ![gabrielle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gabrielle](https://forums.unrealengine.com/u/gabrielle)\
**Post date:** [December 31, 2022, 4:13pm UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/5 "2022-12-31T16:13:50Z")

</div>

Sorry I didn’t see your answer before.  
Thank you very much for your help, this is very much appreciated. I’ll give this a try.

---

<div class="post-metadata">

**Author:** ![Vuong\_Hoang\_Gia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vuong\_Hoang\_Gia](https://forums.unrealengine.com/u/Vuong_Hoang_Gia)\
**Post date:** [June 14, 2023, 5:32am UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/6 "2023-06-14T05:32:40Z")

</div>

Thanks a lot, google search didn’t find it

---

<div class="post-metadata">

**Author:** ![NFU\_Dev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NFU\_Dev](https://forums.unrealengine.com/u/NFU_Dev)\
**Post date:** [October 15, 2023, 10:06pm UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/7 "2023-10-15T22:06:54Z")

</div>

hey , i used this and it works in editor but i want such behaviour at runtime , just to call it once and make a list of missions so i can showcase them in ui, i dont want to keep adding manually to the missions array:  
TArray FoundMissions;  
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked(“AssetRegistry”);  
FTopLevelAssetPath BaseClassName = UMissionObject::StaticClass()-\>GetDefaultObject()-\>GetClass()-\>GetClassPathName();

```
	TArray<FName>Tags;
	Tags.Add("MissionObject");
	AssetRegistryModule.Get().GetAssetsByTags(Tags, FoundMissions);

	FullGameMissionsCount = FoundMissions.Num();

```

if (FullGameMissionsCount)  
{  
//lsome logics here  
}  
else  
{  
LOG\_AMS(“Asset Registry No Assets Found”, 10.0f, FColor::Red);  
}

any advice ?

---

<div class="post-metadata">

**Author:** ![G00D-WangDing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G00D-WangDing](https://forums.unrealengine.com/u/G00D-WangDing)\
**Post date:** [January 11, 2024, 6:55am UTC](https://forums.unrealengine.com/t/getassetsbyclass-node-not-working-in-5-1/696028/8 "2024-01-11T06:55:25Z")

</div>

Excuse me, has anyone solved this problem? I’ve tried a lot of things in Unreal Engine 5 blueprints to no effect, and for some reason I can’t use C++
