create-interface
Create a Blueprint interface with C++ backing for interactable objects.
SKILL.mdUnrealEngine/skills/create-interface/SKILL.md
GitHubSkill: Create Blueprint Interface
Description
Create a Blueprint interface with C++ backing for interactable objects.
Arguments
- {{arg}}: Interface name (without 'I' prefix, e.g., Interactable)
Steps
Create header
I{{arg}}.h:UINTERFACE(MinimalAPI) class U{{arg}} : public UInterface { GENERATED_BODY() }; class I{{arg}} { GENERATED_BODY() public: UFUNCTION(BlueprintNativeEvent) void Interact(AActor* Interactor); };Implement on an actor:
class AMyActor : public AActor, public I{{arg}} { virtual void Interact_Implementation(AActor* Interactor) override; };Call via interface (handles both C++ and Blueprint-implemented interfaces correctly):
if (TargetActor->GetClass()->ImplementsInterface(U{{arg}}::StaticClass())) { I{{arg}}::Execute_Interact(TargetActor, this); }