Why UPROPERTY doesn't work in Interface?

I have a boolean variable in my Interaction Interface, i need to edit this boolean on scene (EditAnywhere), but when i add UPROPERTY it happens:
image

public:
	virtual void InteractionWithMe();
	virtual void ShowInteractionWidget();
	virtual void HideInteractionWidget();
	virtual void SetOutline();
	virtual void RemoveOutline();
	virtual void SetElectricMod();
	virtual void SetOrganicMod();
	virtual void DisableModes();
	virtual void InteractAnyway();

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	bool bInteractAnyway = false;

how i can add UPROPERTY in my interface?

You can’t. Interfaces are by definition classes without properties. And although you won’t get any UHT or compiler complaints about it, they shouldn’t have any non-property member variables either.

This is to prevent “the diamond problem” with multiple inheritance in C++. If there are no members, then you can sort of ignore the inheritance issues.

One solution is a virtual function and either storing the value in the derived type to be returned by an override.
Alternatively it’s worth considering (if you want common data) that perhaps your interface should actually be a component instead.

Thanks, while I was waiting for an answer, I already changed the structure of this code, everything works. Thank you for your reply, you helped me learn more about this