Can a Blueprint Actor Component use Blueprint Interface?

Hi there!
I’m trying to solve a simple problem, at least I think it should be simple.

For Example:
I have several static meshes, let’s say some furniture, and I got an blueprint with an blueprint interface enabling interaction of some sort. Show some info or something like that.
Additionally I have my player blueprint shooting a raycast if an action key is pressed and firing the interaction blueprint via the shared interface, if an static mesh component of this blueprint is hit.

So right now I put the Blueprint in my level choose the staticmesh to use in an public variable and everything works as expected.

Now with version 4.7 I’m trying to put the same behaviour in an blueprint actor component, so it can be added to any static mesh actor already in the scene without the need of replacing it with a blueprint actor.

Only problem the blueprint actor component doesn’t receive any Inputs from the blueprint Interface, I also tried the following tests like shown in the screenshots:
pinting a test string on initialize event - works
setting up the player blueprint so all actors with the interface print test string when action key is pressed - doesn’t work (but works if I use a BPActor not an BPActorComponent)

Any help is appreciated.
Thanks.

Hi there. The problem might be that the event is sended to the ACTOR itself which isn’t listening to the event call, because the interface and the event is only implemented in the BLUEPRINT SCRIPT COMPONENT inside the actor. In this case, you have to to a getComponentsByClass(YOUR INTERFACE) on the actor and then call the interface method on the result.

See also 4.7.5: Interface events not firing in Blueprint script components - Blueprint - Epic Developer Community Forums

2 Likes

My savior. I was looking for that for a while. Well at first I didn’t know what was wrong but after tough debugging session I finally found through Print String that the Actor I thought implements the Interface actually doesn’t. It makes more sense the way it’s in UE4 though so it’s nice to know this finally. Little step by step. :slight_smile: Thx! Too bad the OP didn’t mark your answer as correct because it is.