When compiling on load in -game, a blueprint class that inherits from a native class that is marked within and the class that it is within is abstract, a crash will occur when FBlueprintCompilationManagerImpl::GetOuterForRename tries to create a dummy outer object.
To fix this the NewObject is going to need a way to allow for an abstract object to be created to act as the outer or possibly more reasonably, the Rename needs to be made to allow for the rename to push to a non-within outer, though that does have its own risks.
Add the following code to a .h in a code project
UCLASS(Blueprintable, abstract) class AAbstractClass : public AActor { GENERATED_BODY() public: UPROPERTY(EditAnywhere, Instanced) TArray<class UWithinClass*> ClassObjects; }; UCLASS(Blueprintable, Within=AbstractClass, EditInlineNew) class UWithinClass : public UObject { GENERATED_BODY() };
Compile and run the editor.
Create a blueprint of type WithinClass (WithinBP) and add a boolean variable to it
Place an instance of AbstractClass in to the level
Add an entry to ClassObjects on that instance and select WithinBP
Compile WithinBP
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-109049 in the post.
0 |
Component | UE - Gameplay - Blueprint Compiler |
---|---|
Affects Versions | 4.26 |
Target Fix | 4.27.1, 5.0 |
Created | Feb 20, 2021 |
---|---|
Resolved | Sep 20, 2021 |
Updated | Dec 1, 2022 |