GetMapName() not allowed in Cooked/Packaged builds?

Hello everyone! I’m having a hard time with the GetMapName() function as it seems to crash my cooked build, whereas it works perfectly fine in the Editor. I suspect it’s because of the exact name that I’m trying to check (“UEDPIE_0_GenerateAttempt” sounds like something specific for PIE) - but in that case, how can I get the name of the map that’s gonna work on shipping?

Hmm… prolly I could try to get value straight from the level e.g. when Main Menu triggers being play, it creates name of the level and then pass it to the function in somehow, but hm… still code not gonna know which map has which widget - okay, I’m finishing my mumbling, it’s extremely late - maybe I’ll dream out solution. In a meanwhile, I would be glad for any help and tips! :smiley:

I’m using this function in order to trigger spawn of appropriate UserWidget for specific levels. Along with the message, I’m attaching cpp.

Or if you know better ways for triggering various UserWidgets on various levels, I would be thrilled to hear it out - thank you so much in advance!