Download

Blueprint Interface issue

I have two blueprints which uses the same Interact_Interface blueprint which has Interact function. The image will tell a lot. I’m simply trying to print hello.

4eb2ef234668bc786245a4f09be0b2a5e46d9438.jpeg

Hi jmietola, I think the problem is that you are trying to send the interface message to a reference of the Blueprint2 Class, this will unfortunatly not work, the way I believe you are trying to get this working requires you to set the blueprint2 variable as an actor then drag that blueprint into the level and since you have made that variable shared (represented by the yellow eye) you can edit it in the details panel.
After clicking on that blueprint in the level, that variable then need to be set to an instance of the targetblueprint that, I believe also needs to exist in the level.

Kind Regards, J

I changed that variable type to Actor I have dragged both blueprints in the level. But when I click blueprint at the level I just see the Details panel in the basic editor but I can’t find a place where to set variable to an instance of the target blueprint.

6693efbf40659b093bafd978bf237a0abf7214d9.jpeg

f94cd18beae9ce4cc999d074110bd0b4a2609467.png

1.you can’t change anything while the game is in play in editor mode.
2.that said, you need to also have a actor class object to set the parameter, but you won’t get any since it’s a base class.
So unless you use BP to cast and assign, you can’t assign to it.
3. if you want do it like RostyWulf said, you need to change your parameter type to [your blueprint name]_C so you can drag&drop an instance to the parameter in editor mode.

  1. like this?

Untitled.png

So from where do I drag instance of blueprint2 and where do I drop it? I can’t drag it to variable. It says is … not compatible to replace object reference…

If I promote new variable from target then I can set the class of the blueprint. But I can’t drag the instance from the scene outliner anywhere on the blueprint editor. Just can’t find it.

And what is this? Anyway I can’t set those instances appearing on dropdown.

a20c45a8c16c45e6ac011ec9f6c8dde05f8bb8e2.png

So how to set instance of blueprint to variable? Seems to be too hard :smiley:

Another thing i just thought about is that even if u managed to send it correctly I dont think it is going to be it is going to be called since the event in the first blueprint isnt called? let me try this myself and i will give you the BPs on how you can print things, atleast by activating by keystroke since thats easiest to check :slight_smile: ill give it a go and post again with the BPs when I have the answer.

Kind Regards, J

Okay so, what you need to do is:

  1. Create a Actor Blueprint and add a variable, lets call it targetblueprint, set this variable type to Actor and make it public.
  2. Create another Actor Blueprint(this will be the targetblueprint)
  3. Create your Blueprint Interface and add a function that only holds the default Execute
  4. Implement the interface on both previous Blueprints (targetblueprint and the one from which you send)
  5. In your target blueprint get the Event from the Interface and connect it to your print string.
  6. In your send blueprint connect an event begin play to the interface message like you did before.
  7. Drag both of these blueprint the one you send from and the targetblueprint into the level.
  8. Click the blueprint that sends the interface message and to the right in the details panel you should see “Default” and under that you targetblueprint variable, as long as the targetblueprint is also in the level you can set the targetblueprintVariable to that.
    9.Play

Thank you guys for the effort! The step 8 was main problem, did this and now it’s working. This helped a lot!

Glad to have helped :slight_smile:
If there is anything else don’t hesitate to ask, even someone who has no idea what you are talking about can send you on the right track (personal experience) :stuck_out_tongue: