Interface 'Event' with Output

Hey there,

well, if you get an Error, try to fight it. Can you show me the Interface Function you are trying to use (so the Inputs and Outputs) and the List of Variables and Functions that you have in your Blueprints? (:

Cheers!

So I have a blueprint BaseCharacter_BP that inherits from my interface blueprint. The moment I add an output variable to my interface-event it automatically becomes a function instead of an event. But I can not implement the function in my BaseCharacter_BP (error: " name_of_my_function is in use by another variable or function!".

How am I supposed to implement an interface-event or interface-function in a blueprint that has an output value?

See also: Can't call interface event - UI - Unreal Engine Forums where it is suggested to implement a blueprint function instead of using the event (since the event no longer exists when having an output variable). But doing that gives me that error " name_of_my_function is in use by another variable or function!"

Maybe I’m misreading your goal, but it sounds like what you really want is a delegate:

As seen in the screenshot it’s obviously having a problem with the function I try to make (which I need to implement in the blueprint…) and the one in the interface.
Usually when you create an interface function, you also need to implement the function in the class (or blueprint in this case). But UE4 doesn’t allow that.

I still gotta look into delegates. But it seems those are c++ only and my enum is in blueprints and well, it’s gonna be a huge mess. I don’t understand why the moment I use an Output-variable that UE4 is like “no, now you have to do it completely different and now we want you to use C++ instead” which makes no sense.

That’s a small mistake you’re doing in the Screenshot. (:

You are trying to actually create a NEW FUNCTION with the Name “GetTeam2”. That conflicts with the “GetTeam2” from the Interface!

When you add the Interface to your class, you just need to double-click it in the INTERFACE Menu, right beneath your FUNCTIONS Menu.

You can even see it in your Screenshot :stuck_out_tongue: Here is where you need to double-click:

http://puu.sh/omN4q/09a86f1623.png

Thanks that solved it. One more question though, when I have a PlayerCharacter that inherits from BaseCharacter (which has the interface) then I can not get the interface menu to show in PlayerCharacter so I can implement/override it. I have “Show inherited variables checked”.
Am I doing it wrong again or is it not allowed or?

Thanks a lot for the extremely detailed answers. That helped me a lot.

In a derived class, you are not actually implementing the Interface anymore.

You are OVERRIDING it. So inside of your Child Player Character, go to the FUNCTIONS Menu on the left, where you tried to create a new function earlier. Hover with your mouse over the Header Bar where “Functions (xy Overridable)” stands.

You should now see a button called Override v:

http://puu.sh/omOmL/a82834abbb.png

Click this and you should see a list of Functions you can override. Somewhere at the top, you should find your GetTeam2 function:

http://puu.sh/omOhD/e616858332.png

If you click that, you can implement new behavior for it. The “Parent: GetTeam2” can be used to call the implementation that you did in your Parent class.

http://puu.sh/omOs2/3e4968b452.png

If you can’t manage to find it after deleting, you can always re-add it by right-clicking the Input Part of the Function:

http://puu.sh/omOuV/cb6eb6067f.png

PS: Make sure to accept an Answer if it solved your question, so others see that the question is resolved! (:

Cheers!