Adding entries to TMap fails due to duplicate defaults

Hi,

I just noticed a little bug with the TMap blueprint editor tab:

When you define a TMap variable and the key happensto be an Enum, you are forced to define the first enum value as last. Otherwise, a click on the plus sign will attempt to create a new entry with the default which was already declared.

So, to reproduce:

  1. Create a BP, based on actor
  2. Create an Enum and add the Values “Alice”, “Bob” and “Timmy”
  3. Create a variable of the TMap type in the blueprint and pick a TMap value type (for example Static Mesh)
  4. Add an item to the variable in the etails panel. An entry for “Alice” will be created
  5. Click again on “+” to add another entry
  6. This fails as another entry with the default value “Alice” already exists
  7. Change the first entry key to “Bob”
  8. Click again on “+”. This time it will work and a new entry with “Alice” as default is created.

Its a bit annoying this way.
Maybe that check on duplicates could be done on BP compile time, or intelligently pick an unused enum value for new entries?

Cheers,
Klaus

+1

I have this same exact issue.

Hey KVogler and BananaKing932,

This is a known issue previously reported here. It doesn’t just happen with Enums but pretty much all variable types.

We have it logged as JIRA UE-41910.

Cheers,

TJ

this is not solved yet. it’s annoying restriction. also the fact that we can not reorder item in the map makes it more annoying. I know that order in map does not matter but it matters visually when setting up values. order matters in developement. In runtime it can go in any order and it doesn’t matter