TMap Problem with default Values

The Problem:

I exposed a TMap to be used in Blueprints. I assigned a couple default Values and Place the Actor into the Scene and everything appears as it should. There are 3 Problems that occour when you start to mess around with the default Values of the Placed Actor:

  1. If you delete one default Key or try to add another one all of them dissapear.

  2. If you Modify Key or Value every other Entry disapears.

  3. If you delete all Entrys you cant add a Key that exists in your defaults.

The first two maybe dissired behaviour but the third one definitly not. It Blocks you from adding the defaults back.

Steps to reproduce:

  1. Create Actor or ActorComponent with a TMap in C++ and expose it to Blueprint (use the following example)

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Bug”)
    TMap< FName, FVector > BuggyMap;

  2. Create a Blueprint out of the Actor or add the ActorComponent to a existing Blueprint

  3. Add some default Key Value Pairs to the exposed Map

  4. Place the Actor into the Scene

  5. Test the 3 Problems I described above

If you need more information feel free to Ask. I can also provide screenshots/gifs of the Problem.

Hi Nachtmahr,

I tried to reproduce this in 4.14, both in the binary version installed by the Launcher as well as when built from source code, and did not observe the three behaviors that you described. Would you be able to provide some additional information?

  • Did you make any additional changes to the Actor class, or is the sample code you provided above the only thing that you added to the class?
  • Could you provide examples of the values that you are entering into your TMap?
  • Are you making the changes to the TMap values in the instance of the Actor in the level, or are you doing it in the Blueprint?
  • Do you see this happen only in your project, or does it also occur in a new project as well?

Oh excuse me I had e-mail notifications turned off and forgot about it. I still have the same Project and did not modify anything about the TMap that was Bugged. But I did notice it works correctly if the Property is not on a AActorComponent. It Works with the ACharacter in my test case.

The other thing I should notice is that the Component is Inside a Runtime Plugin I created and I will further investigate where it works and where not but for now let me provide the stripped down Source Code and the Gifs that show what is happening.

Source (inside a Plugin)

Default Values of the Component

Everything that follows is performed on a Actor in the Level trough the Details Panel.
Adding a new Key

Changing a Value

Enter a Key that exist in the default Values

Hi Nachtmahr,

Thank you for the clarification. I believe I had initially only tested with a basic Actor class, which didn’t show the issue that you described. I tried again using a custom Actor Component, and this time I was able to see the results that you mentioned. I will run some additional tests tomorrow and get a report put in about this.

Hi Nachtmahr,

Thank you for pointing out these issues to us. I was able to reproduce the issues that you described when a TMap property was added to an Actor Component, but was unable to reproduce them when the TMap property was added directly to an Actor class. It also did not seem to be dependent on a plugin being used. I have entered UE-40756 to have this investigated further.

I’ve just encountered this exact issue in UE5.1, and I notice the report is marked as “Won’t Fix”.

I have to question why this is, when this is an easily reproduceable issue that doesn’t appear to have any clear workaround? This is really frustrating.