UINTERFACE(Blueprintable)
class UThumbnailActorInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IThumbnailActorInterface
{
GENERATED_IINTERFACE_BODY()
public:
UFUNCTION(BlueprintNativeEvent, Category="KingNet|Thumbnail interface")
void OnGetFocus(const FVector& ImpactPosition, const FVector& ImpactNormal);
But in blueprint I can’t find the “OnGetFocus (Message)” as same as if I declared a Blueprint Interface with a function called “OnGetFocus” inside. I even don’t have a node “cast to ThumbnailActorInterface”.
I’ve no idea what I missed. Or it’s just impossible.
I don’t know if it is the reason, but for blueprint function you must derive from UBlueprintFunctionLibrary and the functions must be static.
An example :
UCLASS()
class KSGM_API UKObjectManager : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
public:
/**
* @brief Helper function to get a pickup object using its UID.
*
* @param UID The unique object id.
* @return The corresponding AKPickupObject pointer.
* If not found, NULL is returned.
*/
UFUNCTION(BlueprintCallable, Category = "Helper|Object")
static AKPickupObject* GetPickupObject(FString UID);
Thanks for reply, but it’s not about BP function.
If you make a BP interface which have declared a function “example function”, you can drag a node “example function (message)” from any target object.
And my problem is that an interface I made in c++ didn’t act like a BP interface.