I have a lot of code similar to this in the event graph of various UMG event graphs:
It all works fine when I run it in PIE, but no event ever gets executed when I “launch” or package it. It doesn’t matter if I use EventTick, EventConstruct or some custom event - never gets executed.
I don’t know what else to tell you… I always compile selecting Development.
Do you have an idea on why it doesn’t get executed?
Huh, I got it. Turns out all you have to do is deleting your Binaries, Build, Intermediate and Saved folders, reopen the editor and repackage the game.
Actually, it works when you delete those folders and launch the game.
If you package the game, it doesn’t - regardless of wether you deleted the folders before or not. And after building the game once, launching doesn’t work either.
Also I just noticed: KeyDown functions don’t work for me, when the game is packaged. I set them up like this and they work, but they don’t when the game is packaged.
After looking through your project I have found that you appear to have circular dependencies in your Character blueprint. This could be what is causing the errors that you are seeing. The dependencies that I have found appear to be those between your Character and your soldiers. After reading your post about how things work one time through after deleting your saved files, this theory becomes even more likely. I hope that this information helps.
I deleted all circular dependencies between the character and the soldiers (MyCharacter has references now to the soldiers, but not the other way round) and checked for correctness using the reference viewer.
But that wasn’t it. Blueprint events still work in editor and still fail when packaged.
I have searched for more circular dependencies and actually found some, that solved some problems in some widgets. Not all - but I’ll keep searching for circular dependencies.
Could you explain what’s the state of circular dependencies right now? Should they work and are being fixed? Or is it recommended not to use them? Both?
I revisited your project and I was able to to the UMG to function.I did this by snagging the current widgets that are being displayed on screen and placing them as children into a new master widget. I hope that this workaround may prove useful for your project.