# Change the Type of an ActorComponent's Owner

**URL:** <https://forums.unrealengine.com/t/change-the-type-of-an-actorcomponents-owner/361971>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 25, 2016, 12:01pm UTC](https://forums.unrealengine.com/t/change-the-type-of-an-actorcomponents-owner/361971 "2016-06-25T12:01:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7b2a231b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7b2a231b](https://forums.unrealengine.com/u/anonymous_user_7b2a231b)\
**Post date:** [June 25, 2016, 12:01pm UTC](https://forums.unrealengine.com/t/change-the-type-of-an-actorcomponents-owner/361971/1 "2016-06-25T12:01:55Z")

</div>

Hi,

I was just wondering if there is a way to change the object type for an ActorComponents parent Actor.

Basically I have an player actor which has an inventory actor component and I was wondering if I could override the owner and declare it as a different type so that I dont have to do casts everywhere. Is this possible?

I.e. when I do GetOwner() it returns my own actor class not the generic actor class.

---

<div class="post-metadata">

**Author:** ![chrismcr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chrismcr](https://forums.unrealengine.com/u/chrismcr)\
**Post date:** [June 25, 2016, 2:26pm UTC](https://forums.unrealengine.com/t/change-the-type-of-an-actorcomponents-owner/361971/2 "2016-06-25T14:26:12Z")

</div>

Since GetOwner is declared on the ActorComponent base class, it can’t know in advance what subclass of Actor you want to attach it to (but I guess you know this already).

If you want to hide the casts you could always declare your own GetMyActor function on your component which calls GetOwner and casts the result to your particular Actor subclass, then returns that.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7b2a231b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7b2a231b](https://forums.unrealengine.com/u/anonymous_user_7b2a231b)\
**Post date:** [June 25, 2016, 2:38pm UTC](https://forums.unrealengine.com/t/change-the-type-of-an-actorcomponents-owner/361971/3 "2016-06-25T14:38:27Z")

</div>

Yeah I figured that might be the best thing to do, but wanted to check. Thanks for the help
