x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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) alt text alt text

Any help is appreciated. Thanks.

Product Version: Not Selected
Tags:
bp_player.jpg (154.6 kB)
more ▼

asked Mar 11 '15 at 09:46 AM in Blueprint Scripting

avatar image

MrBlank
26 3 6 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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 https://answers.unrealengine.com/questions/209730/475-interface-events-not-firing-in-blueprint-scrip.html

more ▼

answered Apr 10 '15 at 05:02 PM

avatar image

spyro
1.5k 83 105 218

avatar image Alphisto Sep 02 '17 at 01:01 PM

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. :) Thx! Too bad the OP didn't mark your answer as correct because it is.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question