Is it possible to use the TSubclassof container with FObjectFinder? I basically want to set the default property of a TSubclassof<UUserWidget> The following doesn’t compile:
So basically what you’re doing there (if you remove the *) is looking for an actual asset of type UUserWidget. Those don’t exist, you have a widget blueprint asset, which has an associated class which is what you’re after. I don’t have time to test it out now, but something like this might do it:
Yeah, searching directly for the UClass like that will work. The only drawback is that you’re then relying on the assumption that the name of a blueprint generated class is the same as the name of the blueprint asset with “_C” appended. It’s unlikely Epic would change this, but it’s not guaranteed. There’s also the (again very unlikely) possibility that this might fail in the case of a naming conflict.