# Can't cast UObject to known parent class in Editor Utility Blueprint

**URL:** <https://forums.unrealengine.com/t/cant-cast-uobject-to-known-parent-class-in-editor-utility-blueprint/1967730>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [August 9, 2024, 12:55am UTC](https://forums.unrealengine.com/t/cant-cast-uobject-to-known-parent-class-in-editor-utility-blueprint/1967730 "2024-08-09T00:55:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeddleGearSalad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/meddlegearsalad/32/88706_2.png) [@MeddleGearSalad](https://forums.unrealengine.com/u/MeddleGearSalad)\
**Post date:** [August 9, 2024, 12:55am UTC](https://forums.unrealengine.com/t/cant-cast-uobject-to-known-parent-class-in-editor-utility-blueprint/1967730/1 "2024-08-09T00:55:08Z")

</div>

EDIT: This is now being tracked in [UE-221973](https://issues.unrealengine.com/issue/UE-221973)

I have an ActorComponent called Comp\_Bark. This is a base class from which I have several derived ActorComponents like Comp\_Bark\_Enemy and Comp\_Bark\_Friend that both have Comp\_Bark as its Parent Class. I have 30 of these ActorComponents that all derive from Comp\_Bark.

I want to write an Editor Utility Blueprint that would let me modify all of them in the same way, with the idea that I could just select these components and run this function as a Scripted Asset Action.

The problem I’m having is that my scripted asset action uses GetSelectedAssets to return the selected assets, which returns them in the form of generic UObjects. If I try casting to Comp\_Bark or try IsChildOfClass to check that it’s parent is Comp\_Bark, it _always_ fails even when I know for a fact that I’m only trying to run my script on 1 Comp\_Bark-derived component, like Comp\_Bark\_Enemy.

 ![whut](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/8/d2893b863ad10493af2531e47762d2835a0b07f6.png)

This always returns “Failure” when I select Comp\_Bark\_Enemy and try running this scripted asste action. Similarly, if I try casting the UObject to Comp\_Bark instead of IsChildOfClass, it always fails the cast despite that i know I’m only running this scripted asset action on a Comp\_Bark component.

 ![whut_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/5/1b5ec638b28bb79194466de2ca3957a102d00d7b.png)  
^This cast always fails on any Comp\_Bark based ActorComponent

How can I cast to the actual object that I’m trying to perform a scripted asset action on? I know for a fact that I’m only trying to run this function on ActorComponents whose parent class is Comp\_Bark.

---

<div class="post-metadata">

**Author:** ![MeddleGearSalad](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/meddlegearsalad/32/88706_2.png) [@MeddleGearSalad](https://forums.unrealengine.com/u/MeddleGearSalad)\
**Post date:** [August 27, 2024, 11:18pm UTC](https://forums.unrealengine.com/t/cant-cast-uobject-to-known-parent-class-in-editor-utility-blueprint/1967730/2 "2024-08-27T23:18:36Z")

</div>

This is now an official bug being tracked: [UE-221973](https://issues.unrealengine.com/issue/UE-221973)
