Blueprint nativization fails if there's any c++ code using TSubclassOf

Calling any C++ method that has TSubclassOf parameter, or attempting to set any TSubclassOf UPROPERTY both cause blueprint nativization to fail.

From looking at resulting code it appears that blueprint translates all subclass references to UClass*, and then fails because there’s no conversion from that to TSubclassOf

Here’s a small project that shows the problem:

TSubclassOf is just template for UClass* which prtty much has only cosmetic effect, you can work around this just by using UClass* insted for now. But it still a bug ofcorse this should not happen, converter probably lose sense of type used in TSubclassOf.

Thanks. That’s what I’m doing at the moment, the problem is that this doesn’t specify to BP what classes the method takes, it just accepts anything and it’s rather unwieldy. Is there some alternative way to give a “hint” to BP on what it should or shouldn’t accept?

Hi moookiexl,

Thank you for pointing this out. I was able to reproduce the issue using a slightly simplified version of your sample project, and have entered UE-42676 to have this investigated further.

Hi moookiexl,

Just a quick update on this issue. I wanted to let you know that we have corrected this issue internally, and the fix will be included in a future version of the Engine.