Implementing a UInterface in a UStruct c++
I have just started learning Unreal and am trying to create a USTRUCT that implements a UINTERFACE
I have an Item struct:
and an Interactable UINTERFACE
The problem is that the header tool expects the struct to inherit from another UStruct and then throws the following error at compile time:
Parent Struct 'IInteractableInterface' is missing a valid Unreal prefix, expecting 'UInteractableInterface'
Is there any way to implement an interface in a UStruct? If not, is my only option then to switch to a UClass?
asked Feb 23 '18 at 09:14 AM in C++ Programming
No, reflection system does not support interfaces in structs, as well as functions which is what you trying to do. But it should work in C++ as long as you not use U-macros on them and potentially you can make static Blueprints nodes to manageable them in Blueprint (for example make function in blueprint that calls struct function).
answered Feb 23 '18 at 03:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here