# C++ How to cast Data Blueprint Parent class with changed variables?

**URL:** <https://forums.unrealengine.com/t/c-how-to-cast-data-blueprint-parent-class-with-changed-variables/482435>\
**Category:** C++\
**Tags:** parent-class, unreal-engine, CPP, question\
**Created:** [April 25, 2021, 12:28pm UTC](https://forums.unrealengine.com/t/c-how-to-cast-data-blueprint-parent-class-with-changed-variables/482435 "2021-04-25T12:28:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Crakmaks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crakmaks](https://forums.unrealengine.com/u/Crakmaks)\
**Post date:** [April 25, 2021, 8:08pm UTC](https://forums.unrealengine.com/t/c-how-to-cast-data-blueprint-parent-class-with-changed-variables/482435/2 "2021-04-25T20:08:04Z")

</div>

I finally found the Solution!

```
UBlueprint* BlueprintAsset = Cast<UBlueprint>(AssetsList*.GetAsset());
if (BlueprintAsset)
{
	TSubclassOf<AWeapon> SubclassOfWeapon = BlueprintAsset->GeneratedClass;
}

```

You can read more about it here:  
[https://forums.unrealengine.com/t/how-to-access-default-values-of-blueprint-assets/60884](https://forums.unrealengine.com/t/how-to-access-default-values-of-blueprint-assets/60884)

---

_[View the full topic](https://forums.unrealengine.com/t/c-how-to-cast-data-blueprint-parent-class-with-changed-variables/482435)._
