We are having an issue with `TInstancedStruct` for USTRUCT() which contains `UObject` reference to `EditInlineNew`, `Instanced` object. If such Instanced Structure is setup in Blueprint defaults, and has instanced `UObject` created for it, then upon blueprint recompilation, the instanced `UObject` is removed. This behavior is inconsistent with how “normal”, non-instanced USTRUCT()s behave. From what we have tested, this issue is present on Actor and Actor’s native default subobjects (components). If, however such `TInstancedStruct` setup is made on Actor Component which is then spawned inside Blueprint, then reference to `UObject` persists, but from our understanding such components are not Actor’s default subobjects.
Steps to reproduce with the following classes:
`UCLASS(EditInlineNew, DefaultToInstanced)
class UInstancedData : public UObject
{
GENERATED_BODY()
};
UCLASS()
class AInstancedStructTestActor : public AActor
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, meta=(ShowInnerProperties))
FStructData NormalStruct;
UPROPERTY(EditAnywhere, meta=(ShowInnerProperties))
TInstancedStruct InstancedStruct;
};1. Launch UE Editor and create new Blueprint which inherits from \AInstancedStructTestActor`
2. Open blueprint editor and locate `Normal Struct`, `Instanced Struct` properties
3. For `Normal Struct` set `Data` to “Instanced Data”
4. For `Instanced Struct` first select `Struct Data` struct type and then set it’s `Data` property to “Instanced Data”
5. Compile Blueprint
6. Notice that `Data` property inside `Instanced Struct` is cleared (None), but it’s preserved inside `Normal Struct`
UCLASS()
class AInstancedStructTestActor : public AActor
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, meta=(ShowInnerProperties))
FStructData NormalStruct;
UPROPERTY(EditAnywhere, meta=(ShowInnerProperties))
TInstancedStruct InstancedStruct;
};1. Launch UE Editor and create new Blueprint which inherits from \AInstancedStructTestActor`
2. Open blueprint editor and locate `Normal Struct`, `Instanced Struct` properties
3. For `Normal Struct` set `Data` to “Instanced Data”
4. For `Instanced Struct` first select `Struct Data` struct type and then set it’s `Data` property to “Instanced Data”
5. Compile Blueprint
6. Notice that `Data` property inside `Instanced Struct` is cleared, but it’s preserved inside `Normal Struct`
Please note that Epic determines whether the issue is made publicly visible, so the tracking link may not work immediately. It can take a few days before the report appears on the public tracker.
You may consider avoiding the use of TInstancedStruct as a native actor class property until the issue is addressed.
I’ll go ahead and close this case for now, but feel free to reply if you have any additional information to share.