Need help with Blueprint Interfaces.

I have an issue with an interface I’m trying to use. Its passing a Bool from a blueprint I created to my HUD. This is how I’ve been using Interfaces:

http://i.imgur.com/UEjlr5h.png

I start by dumping some data out of one of my blueprints. In this case, this is in my Character blueprint. These are some basic stats about my character that I want to display on screen.


This is what it looks like when I call that function on my player character. It works exactly like I wanted, allowing me to display the information from these variables on my HUD. However, I’m now trying to pass a Bool through this same concept and it never works. The set up is like this:


Vary simple, just like my first image, except that I’m using a bool. This is set in my Pickup_Health blueprint. The blueprint can detect if the player is looking at it or not. If it is, it enables key interaction on the player, allowing you to hit E to use the item. This works just fine, here is the section that sets the bool:


Since this works fine, I know the bool is being set to either True or False. However, in my HUD blueprint I get a different result. My best guess is that I’m not targeting the object correctly. The Player status information I mentioned earlier uses the Get Player Pawn action to select its target. However, if I use Select Object, as shown here:


It always posts as False. I have the Pickup_Health selected in the Select Object options and I still return nothing…

((yes I understand its thirst, not thurst btw.))

In the Select Object node you have there you don’t have select A checked, which will make it choose the B slot, which looks like it is not set to anything, so you are trying to call it on an object that does not exist, so it will return false. If you want it to use your Pickup_Health, check the box to the right of where it says Select A.

I feel like I tried that, but I’ll give it a shot when I get home from work.

Hi,

In that SelectObject node, is PickupHealth the name of an actor in the world, or is it the name of a blueprint asset? You need to point at the actual instance of the blueprint you want to send the message to, not to the ‘class’ of all health pickups.

Cheers,
Michael Noland

I too am having problems with BP Interfaces, but mine are more simple. I simply cannot figure out how they work. I’ve read as much as I can find on the documentation and I can’t figure out what I’m doing wrong. I’m trying to just make it so when I left click in my Character blueprint, my Animation Blueprint receives the left click and starts the sword swing montage.

I have a blueprint Interface with a single function “Attack” created, and im trying to make it so that my character blueprint can tell the animation blueprint when a left click was fired.

In the Blueprint Props for the character I chose to implement the Attack function:

And in the Blueprint Props for the animation blueprint I’ve done the same:

But I cant figure out how to link them so the call in my character fires off the call in Anim BP?

EDIT: Nevermind, I got it. I had to get a reference to my mesh and from that get the anim Instance and pass that as the Target. Then in the Anim BP’s version of Attack I had to fire an event that the eventGRaph then received.

I believe that was part of my issue. The other part was that I needed to use Inputs instead of Outputs for some of these. Example: For my “isLooking” interface, I needed to use inputs to send a message from my Pickup_Health item and have my HUD trigger when that message is received and pass the message along to a branch in my HUD. Now I’m able to fire a HUD item that allows me to display things based on what I’m looking at. The “Blueprints Office” example content that was pushed out yesterday really helped me understand what can be done with Interfaces and ultimately helped solve some of my roadblocks that I’ve been stuck on! Very helpful. If anyone reading this is having an issue like this, download that content and look at how the Camera and Light interface with each other. It’s basically the same thing. I’ll post my solution when I get home from work.