Actor Component not reporting correct Owner

When an Actor Component blueprint has a variable exposed to spawn, the Owner is incorrect.

In this example, I made a new Third Person Project. Added a projectile Actor that has no code. Then added an Actor Component (which prints the name of its owner). Finally, added a keypress event to the Third Person Character blueprint so it can spawn a projectile and add the custom component to it. This correctly reports that the owner of the actor component is the projectile it is attached to.

However, if you add any variable to the actor component and expose it to spawn, the owner now reports as the Third Person Character.

Hi Ohriginal,

I haven’t been able to reproduce this on my end. Do you have a sample project that I can take a look at to repro this? I’ll be happy to take a look.

Sure. Just load it up and click “1”. As you can see the components are identical except one has an extra variable, yet they report different owners.

link text

Hi Ohriginal,

I was able to reproduce this on my end and have entered a bug report, UE-20417, to be assessed by the development staff.

The ‘Owner’ is the Actor to which the component belongs (normally the one that created it), not the one it is attached to. It is valid to attach one of your components to another actor, but that does not transfer ‘ownership’.

So how do you get the actor owning a component?

Hmm well in that case the bug appears when you attach an actor component without any variables to an actor. I’m curious then, is there a variable that’s GetActorThisComponentIsAttachedTo or something to this effect?

You can call GetAttachParent on the Component to see what it is attached to, and then GetOwner on that to see which actor ‘owns’ that component.