Problem getting owner of actor component

Hello,

I have a BP Interface for interactable items:


And I have called this interface function in an actor component:


Then I have added this actor component to an actor blueprint (a weapon that can be picked up):

And this is the logic to interact in the character BP:


The error is:
“Blueprint Runtime Error: “Accessed None trying to read property CallFunc_BPI_Function_Interact_Interactable_Reference”. Node: Attach Actor To Component Graph: EventGraph Function: Execute Ubergraph BP Cooper Blueprint: BP_Cooper”

I guess the component is not referencing its owner well? What do I do?

The component implements the interface, and returns the parent actor.

But… this already IS the parent actor :slight_smile:

No?

Also, the actor does not implement the interface.

Okay I have gotten rid of Interactable Reference variable and I have simply attached the Hit Actor to the attach actor to component. Now I can pick up the weapon.

The sword actor BP does not implement the interface, the actor component that is attached to it does. Do I have to make the sword actor BP implement it too?

There’s a discussion about it here

A quick experiment will tell you the answer. I have a feeling the actor needs to implement the interface, but could be wrong…

I just checked it. An actor component can’t implement an interface for an actor BP.

But my actor component only returns information about the owner of that component. And this happens when the interface message is sent from the character BP to the component. So I don’t need the sword actor BP to receive listen to the interface, right?

Maybe I should just do inheritance and implement the interface directly in the master (parent) actor blueprint of all the childs (the different interactable items).

I would probably be cleaner. Otherwise you have to search the components to find if any of them implement the interface