Function in UAssetActionUtility derived class does not show up

I setup a derived class from UAssetActionUtility, and added a function in there, but I cannot find the option when I right click an asset.

h file:


#include "CoreMinimal.h"
#include "AssetActionUtility.h"
#include "PinAssetAction.generated.h"

/**
 * 
 */
UCLASS()
class PINNEDASSET_API UPinAssetAction : public UAssetActionUtility
{
	GENERATED_BODY()
	
public:
	UFUNCTION(CallInEditor)
	static void Generate();
};

cpp file:

#include "PinAssetAction.h"

void UPinAssetAction::Generate()
{
	UE_LOG(LogTemp, Display, TEXT("Test"));
}

Anyone have any ideas what might be wrong?

I managed to fix it myself by accident. For the function to show up in your right click menu, you need to add the BlueprintCallable specifier in UFUNCTION macro

UCLASS()
class PINNEDASSET_API UPinAssetAction : public UAssetActionUtility
{
	GENERATED_BODY()
	
public:
	UFUNCTION(CallInEditor, BlueprintCallable)
	void Generate();
};
1 Like