I think I might be missing something as my cast from an asset UObject to my LootItem interface is causing the following error in the ScriptInterface class:
‘void FScriptInterface::SetObject(UObject *)’ : cannot convert argument 1 from ‘ILootItem *’ to ‘UObject *’
Both methods return the same error though. I have seen this done successfully on a tutorial on the wiki but cannot figure out why it is failing for me.
I have the include in the class trying to perform the cast already. The error itself is being thrown from the ScriptInterface class, so adding any sort of include there isn’t an option.
The only other piece of information that I haven’t included is that the Interface is declared in a module which I’m depending on. I’m not sure if that changes anything though.
The code for the interface:
#pragma once
#include "LootItem.generated.h"
UINTERFACE()
class LOOTSYSTEM_API ULootItem : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class ILootItem
{
GENERATED_IINTERFACE_BODY()
virtual FText GetItemName();
};
I’ve tried a few other ways of writing this out, still having no luck with it. The only thing I can figure is that because the interface is in a dependent module that something is going wrong?