On an actor class I’ve created an UPROPERTY:
UPROPERTY(EditAnywhere, Category = "Devices")
TScriptInterface<class IDevice> Device;
I’ve put an instance of a blueprint that is based on this Actor in a map.
I have a DeviceActor class that is actor class that implements IDevice.
I’ve put an instance of a blueprint that is based on this Actor in a map.
In details tab in this property in the dropdown menu I can’t find this or any IDevices.
Device.h:
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "Device.generated.h"
UINTERFACE(MinimalAPI, BlueprintType)
class UDevice : public UInterface
{
GENERATED_BODY()
};
class IDevice
{
GENERATED_BODY()
public:
virtual void TurnOn() = 0;
virtual void TurnOff() = 0;
};
DeviceActor.h:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Device.h"
#include "DeviceActor.generated.h"
UCLASS()
class ANIMATIONPARADISE_API ADeviceActor : public AActor, public IDevice
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ADeviceActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
virtual void TurnOn() override;
virtual void TurnOff() override;
};
Is there somenthing that I could be doing wrong?