Description

At a licensee, I discovered a problem where Blueprint-created array and map properties are not correctly propagating the ContainsInstancedReferenced property flag. This means that if you create a Map or Array containing references to DefaultToInstanced classes like UWidget or UActorComponent, those references may not get get correctly set to the instanced widget/component when an actor or widget is instanced into a running world. The instancing seems to work correctly in some cases without those flags, but it definitely fails when spawning widgets in Cooked builds as they use a slightly different instancing path than in Editor builds.

The fix is to correctly propagate the ContainsInstancedReference flag for BP-created properties, the way it was already working for native properties

Steps to Reproduce
  1. Make a WidgetBlueprint with a Map of Names to UWidget*. Make that property instance settable
  2. Place an instance of that widget in another WidgetBlueprint, that also has other widgets like labels. Add a name->Widget mapping and assign the widget to one of the labels
  3. Add BP code to the outer widget that prints the full path name of the objects in that map on begin play
  4. Run the game and display that widget. In editor builds this will work properly and the Map will point to the Instance of the label, that lives inside the GameInstance. In cooked builds, the Map will instead point to the Template of the label that lives inside the widget class

Have Comments or More Details?

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

1
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.194.22
Target Fix4.23
Fix Commit6321367
Main Commit6835252
CreatedMay 6, 2019
ResolvedMay 6, 2019
UpdatedJun 4, 2019
View Jira Issue