I am trying to get an Interface to work, that I want to use in C++ classes and in Blueprint classes. But I am not able to make them work at the same time: Either it only works in the blueprint class, or in the C++ class. Simplified versions:
Blueprint version:
UINTERFACE(MinimalAPI)
class UDamageInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IDamageInterface
{
GENERATED_IINTERFACE_BODY()
UFUNCTION(BlueprintImplementableEvent, Category = "Damage")
void TakeDamage(int32 dmg);
};
C++ version:
UINTERFACE(MinimalAPI)
class UDamageInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IDamageInterface
{
GENERATED_IINTERFACE_BODY()
virtual void TakeDamage(int32 dmg) = 0;
};
There should be a way to override the top method, but whatever I try the new Function doesn’t get called.