c++ interface not visible in blueprints

So i have this little interface

UINTERFACE(MinimalAPI)
class UTurnSubject :
	public UInterface
{
	GENERATED_UINTERFACE_BODY()
};

class ITurnSubject
{
	GENERATED_IINTERFACE_BODY()

	virtual void Attach(AArmy*);
	virtual void Detach(AArmy*);
	virtual void Update(int8 player);
};

That is implemented here:

UCLASS(placeable)
class STRATEGY_API AStrategyTurnControl : public AGameMode, public ITurnSubject
{
	GENERATED_UCLASS_BODY()

	UFUNCTION(BlueprintCallable, Category = "TurnControl")
		void ChangePlayer(int8 newPlayer);
	
	UFUNCTION(BlueprintCallable, Category = "TurnControl")
		virtual void Attach(AArmy* army) override;
	UFUNCTION(BlueprintCallable, Category = "TurnControl")
		virtual void Detach(AArmy* army) override;
	UFUNCTION(BlueprintCallable, Category = "TurnControl")
		virtual void Update(int8 player) override;

	UPROPERTY(AdvancedDisplay, BlueprintReadWrite, Category = "TurnControl")
		TArray<AArmy*> AllTheArmies;
};

And i can’t see anything in the blueprint editor. No interface, i can’t implement it to other blueprints and no functions anywhere.

  1. If you use MinimalApi in the interface declaration then you won’t see any interface messages in blueprints

  2. You need to decorate your interface methods if you want them to show up in the editor. something along the lines of :

UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = SomeCategory, meta = (FriendlyName = “Can Handle Entity Now”))
bool CanHandleEntityNow

EDIT : I’ve noticed that I have had to restart the editor after adding new interfaces in code for them to show up.

Actually I’ve since run into this same issue using the above methods. One interface I made this morning shows up fine while the newer ones I created don’t.

I will post back if I manage to figure out what the issue is.

After some head banging I restarted the editor and everything showed up. So it looks like to be safe you will want to restart the editor after adding new interfaces in code.

The reason for the reboot being needed is because FK2ActionMenuBuilder::GetAllInterfaceMessageActions is run when you open the blueprint window to gather all of the interface functions that can be called via blueprints, and it isn’t run again.

You could probably just close and reopen the Blueprint editor to reload the info after making changes to interfaces, too.