BP Interface Problem..

Hey guys.

I must be doing something wrong as for the life of me i cant get my controller blueprint to send a var (true or false) to my item blueprint using a blueprint interface.

watched so many vids over and over on blueprint comms but still cant get the hang of it lol.

any ideas what am doing wrong here?

I believe your problem is your calling it properly, but you haven’t setup receiving it right. When you right click to add it look under add event instead of call function.

We’re missing something here.

In order to create a interface you have to create a new blueprint interface. then you must create some functions inside this blueprint interface. These functions do not contain code but your method names and properties. Then you need to use blueprint props/class settings to add the interface too the blueprint and then you have access to the interface and can communicate between blueprints… kinda like,

Blueprint interface - test function
MyCharacter blueprint - add test interface (this is the most important step, i had to double check where this was, in your blueprint, click class settings (Or blueprint props in older versions), and in the details pain near the bottom for interfaces add your custom interface.)
Now you have access to these interface functions inside your character class. This is where you drop the code.
From any other blueprint- get player pawn - access test function

This is the preferred way of blueprint communication. Now the other way is simply casting:

MyCharacter blueprint - create a test function (visible/public)
Any other blueprint - GetPawn -> Cast to MyCharacter blueprint -> test function (Notice how when we use interfaces we don’t have to cast to our sub class, we can just access the properties directly from our get player pawn function)

No worries, it took me a few days to grasp the concept myself.

I got the casting working :slight_smile:

The Blueprint interface tho i must be using wrong. as still cant get head around that.

This is what am doing… has to be wong tho :stuck_out_tongue:

  1. Create Blueprint Interface

  2. Add testFunction

  3. Add Input Bolean var to said testfunction while in the Interface

  4. Add Output Bolean var to said testfunction while in the interface

  5. Add Interface to My Controller Blueprint

  6. Add Interace to SpawnItem Blueprint

  7. Add node testFunction (message type) in my controller and connect a bolean var to the IN pin.

  8. Add Node testFunction (??) in SpawnItem Blueprint and connect OUT pin to print screen (to see if it passes over)

Clearly i must be wrong somewhere.

atleast ive got my head around the casting heh. be nice to work out this BPI stuff aswell tho :slight_smile:

So that sounds about right. Where are you accessing the controller/spawn item blueprint?

Example if you are in your level blueprint you want to Get Player Controller -> testFunction. Can you confirm that works?

i have it sort of working but its a weird one.

below WORKS

This does **NOT **work? Are u not meant to pass straight through ? or am i thinking that how it works is all wrong?

The Controller (trying to send the var)

and the My Character (trying to get the var)

Thanks for the help in trying to get my head around these.

If I am understanding correctly, everything up to here is correct. What you are doing here is simply calling the function again, not executing it once called.

Here is an example that I use. My function from my Interface is called DisableIsActive. Right click in a blank area and find your function as an event instead of dragging off the event tick and only getting a function call.

7c182bedbb33e7da83c7b979caf60e26c554bd25.jpeg

I hope I am understanding right and this helps you out.