As the title describes, we’ve found a repro in 5.5 where the elements of a TArray of Instanced UObjects are unexpectedly set to None when a blueprint component is recompiled.
#pragma once
#include "Components/ActorComponent.h"
#include "XYZTestInstancedObjectsComponent.generated.h"
UCLASS(Blueprintable, BlueprintType, EditInlineNew)
class XYZGAME_API UXYZTestInstancedObject : public UObject
{
GENERATED_BODY()
};
UCLASS(BlueprintType, Blueprintable, meta=(BlueprintSpawnableComponent))
class XYZGAME_API UXYZTestInstancedObjectsComponent : public UActorComponent
{
GENERATED_BODY()
protected:
UPROPERTY(EditDefaultsOnly, Instanced, NoClear)
TArray<UXYZTestInstancedObject*> InstancedObjects;
};
Using the above code:
- Create an Actor
- BP_Test_Actor
- Create a Blueprint Component derived from UXYZTestInstancedObjectsComponent
- Comp_TestInstanceObjects
- Add Comp_TestInstanceObjects to BP_Test_Actor
- Add elements to the InstancedObjects array on the added component, set them to the base type UXYZTestInstancedObject
- Open the Comp_TestInstanceObjects blueprint and press Compile
- Observe that the array elements on the Comp_TestInstanceObjects attached to BP_Test_Actor have been set to None
In testing, we see that this appears to be fixed in 5.6, but we’re not looking to take that version yet, and are interested in finding the specific CLs we might be able to cherrypick. Any ideas?