I have a class which has a getSomething() function that I want to return an Interface.
So that class header looks something like this
UCLASS()
class TEST_API AMyPawn: public ADefaultPawn
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "Stuff")
TScriptInterface<ISomethingInterface> getSomething();
private:
UPROPERTY(EditAnywhere)
TScriptInterface<ISomethingInterface> ourSomething;
}
then I have two implementaitons of an interface. The interface header looks like this:
UINTERFACE(meta=(CannotImplementInterfaceInBlueprint))
class USomethingInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class TEST_API ISomethingInterface
{
GENERATED_IINTERFACE_BODY()
// Add interface functions to this class. This is the class that will be inherited to implement this interface.
public:
UFUNCTION(BlueprintCallable, Category = "Stuff")
virtual FString getType() const = 0;
};
It all compiles fine, but when I try to create a variable in BluePrint the SomethingInterface claasses are not availble to select, so I cant use the interface in my BluePrint. What do I do?