// IInteractable.h
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "IInteractable.generated.h"
UENUM(BlueprintType)
enum class EDisabledInputTypes : uint8
{
None UMETA(DisplayName = "None"),
Movement UMETA(DisplayName = "Movement"),
CameraRotation UMETA(DisplayName = "Camera Rotation"),
Jump UMETA(DisplayName = "Jump"),
CustomInput1 UMETA(DisplayName = "Custom Input 1"),
CustomInput2 UMETA(DisplayName = "Custom Input 2"),
// Add more as needed
};
UINTERFACE(BlueprintType)
class UInteractable : public UInterface
{
GENERATED_BODY()
};
class IInteractable
{
GENERATED_BODY()
public:
// Function to enable interaction with the object.
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Interaction")
void EnableInteraction(EDisabledInputTypes& OutDisabledInputTypes);
// Function to disable interaction with the object.
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Interaction")
void DisableInteraction(EDisabledInputTypes& OutDisabledInputTypes);
};
Would this approach be suitable for an interaction system in Unreal?
Context: I want to create an interaction system where objects like doors can disable camera movement while the player pushes or pulls them, controlling their yaw and similar behavior. Would making an interface for interactable objects be a good approach for implementing this system?