C++ class reinitialize with overwritten default values from blueprint

Hi everyone,

i’ve created a custom UObject derived class which has some UProperties and also a TMap. The values of the TMap are made available through a UFunction. In the constructor I initialized the UProperties with some default values and also added some of them to the TMap.

I then derived a blueprint from that class in order to overwrite the default values for more flexibility. Unfortunately all values added to the TMap are still the same as in the c++ code. If I access some of the UProperties directly I get the overwritten value, but the values in the TMap are not the overwritten ones.

What am I doing wrong here? I really appreciate every help :D.

btw I’m accessing all values from another blueprint.

[EDIT]

I solved it by storing pointers to the UProperties within the TMap instead of copies.

Hey -

It sounds as though you were able to find a solution to your issue which is good to hear. I will be marking this post as resolved to tracking purposes, however if you are still having problems related to initializing your blueprints properly feel free to reopen this post.

Cheers

is there a code example for your solution for this anywhere? Im having an issue similar to yours where a created blueprints default value are to null on creating an instance of the blueprint for a level.

Hi there, here is a link to the class I was talking about: https://github.com/gotschmarcel/mtmaster-game-dev/blob/dev/Nightmares%204.6/Source/Nightmares/NBalanceSingleton.h. As you can see instead of storing copies of the UProperties I stored pointers to them in the map.