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.
asked Mar 11 '15 at 09:46 AM in Blueprint Scripting
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here