How to get an interface pointer variable to work w/UPROPERTY()

Are you setting this TScriptInterface as a property via BPs? It can only be set by native C++, not Blueprints or any other system.

TScriptInterface is like a tuple of UObject*andIMyInterface*. It holds a UObject*to keep the GC happy and aIMyInterface*to make calls against. Setting it in native code, you have to pass theIInterface*- it will copy that and then cast back to theUObject*` to store that too.

But if you set it in any other way (e.g. reflection, via BPs), then you will only be setting the UObject* part. That sounds like it could be the reason why you have an object but no interface.

Steve

2 Likes