# Get a reference to component owner while in blueprint editor

**URL:** <https://forums.unrealengine.com/t/get-a-reference-to-component-owner-while-in-blueprint-editor/568421>\
**Category:** C++\
**Tags:** actor-blueprint, unreal-engine, UE5-0, Components, question, Blueprint\
**Created:** [May 28, 2022, 5:28am UTC](https://forums.unrealengine.com/t/get-a-reference-to-component-owner-while-in-blueprint-editor/568421 "2022-05-28T05:28:17Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Ciberus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ciberus/32/561261_2.png) [@Ciberus](https://forums.unrealengine.com/u/Ciberus)\
**Post date:** [July 8, 2023, 1:26pm UTC](https://forums.unrealengine.com/t/get-a-reference-to-component-owner-while-in-blueprint-editor/568421/6 "2023-07-08T13:26:38Z")

</div>

Thanks a lot, i have small addition to your solution.

`GetAllNodes()` returns only ActorComponents created in Blueprint here how to get ActorComponents created in C++ also, via `BlueprintGeneratedClass->GetDefaultObjectSubobjects()`

> [@How to get a component from a ClassDefaultObject?](https://forums.unrealengine.com/t/how-to-get-a-component-from-a-classdefaultobject/383881/9):
>
> Found solution on how to get all ActorComponents(both created in C++ and Blueprint) from another ActorComponent(non SceneComponent). If you need to get ActorComponents from Actor itself replace GetOuter()-\>GetClass() on GetOwner()-\>GetClass() code example static TArray\<FString\> GetHitRegistratorsNames(UObject\* OwnerObject) { TArray\<FString\> Result = {}; UBlueprintGeneratedClass\* BlueprintGeneratedClass = Cast\<UBlueprintGeneratedClass\>(OwnerObject); …

---

_[View the full topic](https://forums.unrealengine.com/t/get-a-reference-to-component-owner-while-in-blueprint-editor/568421)._
