Hi there, I am spawning an Actor with a EditorWidget and am trying to call a interface which is implemented by an Actor but the method of the function should be implemented in the blueprint not in the c++ base class.
So I do the following:
//Spawning from UEditorUtilityWidget
auto SpawnedActor = SpawnBlueprint<AActor>(Blueprint, FVector::Zero , FRotator::Zero);
bool isExtendableItem = SpawnedActor->GetClass()->ImplementsInterface(UExtendableItem::StaticClass());
if (isExtendableItem)
{
UE_LOG(LogTemp, Warning, TEXT("Extendable my friend %s"), *SpawnedItem->GetName());
IExtendableItem::Execute_ExtensionDimension(SpawnedItem, FIntVector(10, 0, Z), 200);
}
//ExtendableItem.h
UINTERFACE(MinimalAPI, Blueprintable)
class UExtendableItem : public UInterface
{
GENERATED_BODY()
};
class CHROMAGUN2_API IExtendableItem
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent)
int ExtensionDimension(FIntVector size, int TileSize);
};
The blueprint implementation:
https://prnt.sc/okEY3fiKaNV7
okEY3fiKaNV7[1] (15.9 KB)
But the string is not getting logged, am I missing something?