Hello I am trying to update my plugin for Unreal Engine 5. I am able to use the plugin in my editor and it works fine but on packaging, I am getting an Error on ClassGeneratedBy.
Subsystem = GetWorld()->GetGameInstance()->GetSubsystem<UMortarResourceManager>();
if (Subsystem)
{
UClass* Class = Subsystem->GetClass();
UBlueprint* BP = Cast<UBlueprint>(Class->ClassGeneratedBy); //this line gives error
}
error C2039: ‘ClassGeneratedBy’: is not a member of ‘UClass’
I see that this variable is under WITH_EDITORONLY_DATA macro in Unreal Engine 5 but earlier it was not. What’s the reason and what is the alternative?
“What is the alternative” is much easier to answer if you were to describe what you actually want to do with this blueprint.
One option is to manually add the necessary data/class references as an explicit UPROPERTY() on the UObject in question and configure it the way you want it.
The blueprint is containing all the settings and I want to ensure that the subsystem I am picking is not the c++ one but instead the blueprint one. Here I am only checking if the Blueprint pointer is null or not. If null then I just return null otherwise I return Subsystem ptr;