Packaging with Nativize Blueprints enabled causes assert on loading blueprint class about multiple components with the same name
I have an actor in C++ that creates a number of components in it's constructor, like so:
I then have a number of blueprints based on this actor, which mostly just tweak settings, meshes etc. on the existing components, to create the specific instances of this class.
When packaging with nativize assets, the game asserts when running the package. The assert hit is here:
UObjectGlobals.cpp line 3714
. [2017.03.15-18.04.56:622]LogHAL:Error: appError called: Assertion failed: Assertion failed: [File:F:\work\projects\unreal\415\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 3714] Default subobject BoxComponent TriggerVolume already exists for BP_MyBlueprintClass_C /Game/Objects/BP_MyBlueprintClass.Default__BP_MyBlueprintClass_C.
Looking at the code generated by the nativizer for this blueprint, I can indeed see that there are duplicate components being created with the same name, as both my C++ game code, and the nativized blueprint generated code, are trying to create the component. The constructor generated by the nativizer contains this snippet:
i.e. both constructors are creating the TriggerVolume component.
There are a number of other components in the class that are declared and constructed in exactly the same way, which the nativizer correctly deduces and accesses in its generated constructor like so:
I can't see any difference between the components that work and the component that doesn't, so I can't see anything to change on the game side to try remedy the issue.
Note that the only package I've checked for this is a PS4 development build (everything seems fine in a shipping build, where the assert is defined out, though I guess in this case perhaps there just are duplicates of this component but everything manages to work okay regardless).
Thanks for reading this far! tom
I'm afraid that I'm unable to give you an answer at the moment, as our project currently fails to compile when using Nativize Blueprints; i.e. the nativizer generates code that does not compile. I've been able to work around similar issues in the past by tweaking blueprint logic, but right now I can't see any way to trick the nativizer into generating the correct code in these cases. If I get chance, I'll make a separate post / bug report for these compile errors.
Follow this question
Once you sign in you will be able to subscribe for any updates here