Developer Notes

No longer able to reproduce the issue in released 4.9.2

Description

If an array of custom UObjects is added to a class, changing the value of a UPROPERTY variable in one element of the array sets the same value in all elements of the array.

Steps to Reproduce
  1. Create a new code project using the first person template.
  2. Add a new Actor class to the Engine. Name it MyActor.
  3. Add a new Object class to the Engine. Name it MyObject.
  4. Open the project in Visual Studio and close the Editor.
  5. In the header file for the new object class, include the following UCLASS specifiers: UCLASS(Blueprintable, BlueprintType, DefaultToInstanced, EditInlineNew)
  6. Add the following code to the header file of the new object class:
    public:
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ExposeOnSpawn))
    	float SomeValue;
    
  7. In the header file for the new actor, add the following code:
    public:
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
    	TArray<TSubclassOf<UMyObject>> MyClassesArray;
    
  8. Add an include for MyObject.h in the new actor header file.
  9. Build the project in Visual Studio.
  10. Open the project in the Editor.
  11. Create a new Blueprint derived from MyActor.
  12. Place an instance of the new Blueprint into the level.
  13. In the Details panel of the new Blueprint, find the My Classes Array and add three elements to it.
  14. Set each of the three elements to MyObject.
  15. Expand the elements until you see the Some Value variable for each one.
  16. Select the Some Value variable for one of the elements and enter a new value.

RESULT:
The same value is placed into the Some Value variable for each element in the array.

EXPECTED:
The only value that is changed is the one that was selected.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.6.14.8
Target Fix0
CreatedDec 29, 2014
ResolvedOct 6, 2015
UpdatedApr 27, 2018