Cannot call interface function

I have an interface and a class that attempts to implement it. I know that when you call a function through an interface, you have to use the Execute_ prefix with the method name. However, whenever I try to call a function using the Execute_ prefix, I get a build error:

class “IExampleInterface” has no memver “Execute_ExampleFunction”

Everything else about the interface works as intended. I just cannot get this to work. Below is my work.


#pragma once

#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "IExampleInterface.generated.h"

class UExampleInterface : public UInterface

class FPROJECT_API IExampleInterface

        void ExampleFunction(float ExampleParam);


What I’m trying to do

//This works with no error. ExampleClass implements IExampleInterface
IExampleInterface ExampleInterface = Cast<IExampleInterface>(ExampleClass);

        //This throws the error previously mentioned at the top
        //Intellisense can see ExampleFunction,
        //however it cannot see Execute_ExampleFunction
        ExampleInterface->Execute_ExampleFunction(ExampleClass, 1.0f);

Any help is appreciated.

You can call the method without the “Execute_” prefix as it’s a C++ only method.
The “Execute_” prefix is generated for blueprints exposed methods and therefore you should only use the “Execute_” prefix in those methods.

Thanks for the reply. This worked for me, however I ran into other problems when doing that. I’ve since fixed them.