Map variable with value type 'Object' does not work for Blueprint instances

Good evening,

There is a rather significant bug using Map variables with either value type ‘Object’ or value type of structure which includes another variable of type ‘Object’. Changing them in instances of the actor leaves them at default values in Simulate and PIE. But follow the steps to reproduce explains it better:

  1. Create blank project
  2. Create an actor Blueprint
  3. Add a Map variable of type e.g. Name to Object (bug persists with other key types as well)
  4. Add one or more default values to the map: e.g. 'None' -> 127grey texture (any object)
  5. Place the Blueprint in level and change the value(s) of your default map entries.
  6. Simulate game; select Blueprint instance in World Outliner and see there is still 127grey assigned.

Bigger problem with structures:
Let’s have a Name to Struct map variable with default as follows:

'Name' -> Struct {
  Object: 127grey 
  String: 'Testing'
  Integer: 42
}

In the Blueprint instance changing the String and Integer to other values gets ignored in Simulate and PIE. Clearing out the Object to ‘None’ let the new String and Integer values persist to Simulate and PIE. As long as there is an Object assigned (even the default value), ALL values of the struct are set back to Blueprint default in Simulate and PIE.

Workaround for now:
I have noticed that the bug does not happen if you add or remove an element in the Blueprint instance (the objects of the remaining elements are changed correctly in Simulate and PIE). If you have e.g. 3 default key-values and just rename one of them in the level instance, the bug persists, though. Adding or removing is mandatory.

Cheers,

I thought the following was related, but did not fix it:

4.18.1 patch notes: “UE-51504 Inherited TMap value of type UObject* is not saved on blueprint compile”

Hello ,

We are using a new bug submission form. Please navigate to the link below for more information.

Link: Unreal Engine Bug Submission Form - Announcements - Epic Developer Community Forums

Make it a great day

I’m having the same issue and the workaround worked for now

@

A bug has been created here: UE-54903