How can I use a blueprint interface with my HUD blueprint?

So, i’m a noob, i know, i try my best to learn unrealengine 4, but i have a problem:

Basically, i have a really simple setup, my goal is when my character in a 2D scroller template overlaps a box, there is an event that fires via an interface, and then to a HUD, so a message gets printed on the screen.

these are my 3 blueprints:

And this is the third one:

hy danafo! Thanks for responding.

Yes, i did, else i couldnt call the interface function.

Hi did you make sure that your blueprints all implement the interface blueprint?

Oh right - ok I just did a test on my pc and it looks like ‘target’ variable is empty, or uninitalized. I believe that if the blueprint/class you are trying to reference doesn’t exist/is instanced in the level, then you need to initialize the blueprint type variable in the CONSTRUCTION SCRIPT (the script that is called on game start on the blueprint) and specifically place the blueprint/object you want to use as reference inside the ‘target’ variable before you can use it.

Here’s what I did in my setup (you would do this inside your PlayerGameOver blueprint construction script graph)

To clarify a bit, what I’m calling CamActor Test is the same as your Target variable:

Let me know if this makes sense, ask anything you need.

Hey Zeusdamage,

In your 3rd screenshot where you are calling the event and passing in the HUD blueprint variable, that’s not actually calling the event on the HUD that’s in use by the game, that’s just trying to reference the HUD blueprint class in general. If you’ve setup a Game Mode blueprint that uses your custom HUD and set that Game Mode in the level’s Blueprint settings, then in order to call this function to your HUD, you would reference like so:

This way you are calling the instance of the HUD BP that’s in use by your level and not the class.

Hope that helps!

-Steve

That actually helps me as well, knowing that this is how you pull the level instance of the game blueprints. Initializing blueprints for reference and game blueprints are very poorly documented in my opinion, I’ve tripped up a lot on these.

Thanks all for the answers, i will check them out tomorrow.

This works just as i wanted it! thanks, Steve and DanaFo!