Blueprint Interface Not Working

Is your actor placed in your level AND possessed? (click on the actor in the level and check on your right hand side that “Auto possess player” is set to Player 0)

Best,
Alessandro

2 Likes

For the life of me I can’t figure out why my BP Interface set up isn’t working.

I have literally followed everything I can see in a good tutorial. It worked exactly as I followed along, but not in the project I watched the tutorial for once I tried to re-implement what I learned. Any help would be greatly appreciated.

Here’s my setup:

  • All actors are in the persistent level (no sub levels), so that should help clear the waters.
  • I’m calling the Interface message (“DoorInteract”) in FirstPersonCharacter BP via a ‘Z’ key press (for testing)…

  • I’m calling the Interface Event in my “Door” BP, which has the Interface implemented…

  • And here’s the Interface they are both referring to, called “BPI_Char”, with the “Door Interact” function highlighted…

  • Everything is compiled and saved.
  • The DoorInteract event on the Door BP isn’t firing at all, so it’s not printing the test string.

I’m a major n00b, so I’m certain there’s a fundamental concept that’s whizzing over my head.

thanks in advance for any advice!

If you’re asking about my FirstPersonCharacter, then yes, it’s set to that. I don’t see anything like that in the options for my door (since it’s not a character, I’m assuming).

Hi,

The reason your interface is not working is that you’re trying to call the function as if your FirstPersonCharacter implements it. Your 2nd blueprint shows that Door is the one who implements this interface while in the 1st picture, you pass Self as a Target and try to call its function DoorIntact. Since your FirstPersonCharacter doesn’t implement this interface, it obviously doesn’t have this function and so it will do nothing! (Though the ideal case for blueprints would have been to complain about this and throw an error or something).

Introducing a function through interface doesn’t necessarily make that function static and globally accessible! You would still need to call it through the actor who implements it.

To make this work, instead of Self, you need to get a reference to your Door from somewhere and use that as Target. You can also verify that your FirstPersonCharacter doesn’t implement this interface by using the node “Does Implement Interface” before trying to call an interface method with it.

Hope this helps.

1 Like

This helped me out so much. It was just the missing link in my understanding and a lot of concepts really clicked into place for me. Thank you so much, Vizgin!

You’re very welcome :slight_smile:

Thank you! This also helped me, I was stuck for a good hour before finding out this was the problem.

To make this work, instead of Self,
you need to get a reference to your
Door from somewhere and use that as
Target.

This is the bit I don’t understand. HOW do you get a reference from “somewhere”. What does that mean?

Hey Kel Knight,

Depending on the scenario you work with, there are various ways you can use to access different objects within your level that your pawn interacts with. In the case of this question, one simple way would be to add a collision box to your door (you would need to adjust the collision settings so that your pawn can overlap with it). Next, in your pawn blueprint, you can check for overlap events and once the pawn enters the box, you can get the reference to the actor (door in this case) that your pawn overlapped with and call its interface function to open it.