TMap inside struct won't update values in Editor (Bug?)

I want to display the contents of TMaps which are part of larger structs of data.

The struct is visible in the Editor Details panel and shows all Uproperties fine, but when I try to add entries to the map with c++, these don’t show up.
I have tried to place a second TMap alongside the struct separately and if I add entries here with c++, they show up instantly.

The property specifiers above both TMaps are exactly the same and the entries are added to the maps in the same place and in the same way.
The only difference seems to be that as soon as TMaps are inside a struct, their values will not update.

Am I missing something obvious, is this a bug, or simply intentionally not supported?
What would be an alternative to this?

1 Like

I have now tried using a TArray, but this presents the exact same issue.
TArrays inside of structs will not display their elements in the details panel either when they are added at runtime.

I’ve found out what was going wrong, inside the foreach loop in which I edited the structs maps and arrays these structs were not yet being passed as a reference. I assumed this was already the case and obviously the debug logging (from which i derived the containers DID contain the new elements) were being done for the copies created inside the foreach loop.

All I needed to do was make the foreach loop like this:

for (FProjectVariant& Variant : Variants)
{

}

(addig the & for reference)

1 Like