Call Interfrace default Implementation in overridden function

So, I have an Interface to be implemented by some of my Actors. I thought it would be best to put in its default implementation methods to be called in all classes that implement it, to avoid replicated code. Much like calling the default implementations in parent classes (as Interfaces are just multi-inheritance in the end).

Still, I get an error when I try to:

void AMy_Actor::InterfaceFunction()
{
    Super::InterfaceFunction();

    /* custom implementation for My_Actor */
}

The error says that it can’t find “InterfaceFunction” in AActor. This suggests that “Super” only checks for the main parent class (AActor, in this case). Is there anyway for me to call the default implementation of an Interface function in an override, just as it is done in calling parent class functions?

Is AMy_Actor derived from another custom class that implements your interface?

Edit: Oh, I get it. Yes, the parent is only the first class indicated after class AMy_Actor :
Everything else after a comma is not a parent class.

Interfaces don’t have implementation of the functions declared in them, so you mustn’t call Super:: for interface functions, unless the parent class implements the same interface and does some stuff too.

2 Likes