Description

When duplicating an element of an array of EditInlineNew UObjects, a reference to the duplicated element is created instead of creating a new UObject that duplicates the initial element's properties. This results in changes to either the original element or the duplicate element also changing the other element.

Steps to Reproduce
  1. Create a new code project using the first person template.
  2. Build the project in Visual Studio.
  3. Open the project in the Editor.
  4. Add two new UObject code classes to the project.
  5. Close the Editor and open the project in Visual Studio.
  6. In the header file for one of the new UObject classes, add the following UCLASS specifiers: Blueprintable, EditInlineNew, BlueprintType
  7. Add the following UPROPERTY to the same header file:
    public:
    	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Properties")
    	int32 MyValue;
    
  8. In the header file for the other new UObject class, add the Blueprintable UCLASS specifier and the following UPROPERTY (where the TArray is of the type of the other UObject class):
    public:
    	UPROPERTY(EditAnywhere, BlueprintReadOnly, Instanced, Category = "ClassData")
    	TArray<UMyObject*> ObjList;
    
  9. Build the project in Visual Studio.
  10. Open the project in the Editor.
  11. Create a Blueprint from the second UObject class.
  12. In the Blueprint, add two or three elements to the ObjList array.
  13. Edit the value of the MyValue variable in each element so that they are all different values.
  14. Right-click and copy one of the elements.
  15. Add a new element to the array, right-click the element and select Paste
  16. Edit the value of the MyValue variable in either the original or the newly pasted element.

RESULT:
Changing the value for the original or new duplicated element changes the value for both elements.

EXPECTED:
Changing the value for the original or new duplicated element only changes the value for that element.

Update - TimL
======
The behavior noted above still occurs when duplicating elements of an array if the array is a property of a Data Asset class.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-20213 in the post.

28
Login to Vote

Fixed
ComponentTools
Affects Versions4.8.34.94.104.12.54.134.20
Target Fix4.22
Fix Commit4509726
Main Commit4676940
Release Commit4862694
CreatedAug 20, 2015
ResolvedOct 25, 2018
UpdatedFeb 12, 2019
View Jira Issue