Duplicating a UActorComponent that has an Instanced UPROPERTY does not perform a deep copy of the instanced property. It appears to only copy a reference to the instanced object. Where as, performing a copy of an instanced component will be treated as a "deep copy" instead of a reference.

Steps to Reproduce

Project has been attached for easier reproduction.

  1. Open up the attached project
  2. From the Content folder, create a new Actor Blueprint.
  3. From the Add Component tab->Custom-> add a DuplicateInstanceBug component.
  4. Select the Component , in the details panel you will notice the instanced property field, use the drop down to select Duplicate Instance Bug Object.
  5. Edit InstancedProperty->DuplicateInstanceBugObject->EditMe String field with some text.
  6. Compile & Save.
  7. Duplicate the original component using Ctrl+W.
  8. Copy and paste the original component using Ctrl+C then Ctrl+V.
  9. Edit both the duplicated component's and the copied component's InstancedProperty->DuplicateInstanceBugObject->EditMe fields using different values for each.
  10. Compile & Save.
  11. Notice how the change made to the duplicate's field propagated to the original but the change made to the copy's didn't.

All three components should have their own InstancedProperty object.

The original component's and the duplicated component's InstancedProperty fields point to the same object.

Have Comments or More Details?

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

Login to Vote

ComponentUE - Gameplay
Affects Versions4.204.214.22
Target Fix5.0
Fix Commit16751046
Main Commit16751102
CreatedJan 21, 2019
ResolvedJun 22, 2021
UpdatedJul 7, 2021