Hi everyone, I’m profiling my game right now and I’m noticing an almost 100 ms hitch when I create and set a UMG widget via blueprint. For context, when an enemy in my game takes damage for the first time, I create a healthbar widget on the first instnace of damage. This is when the hitch occurs.
What’s interesting is that this happens only the first time I create the widget. Any subsequent enemies that take damage and run the function won’t hitch. Here’s the function:
The hitch happens on the “set variable” function.
Anyone have any idea of what’s going on? Seems like its related to the creation of the widget, so I almost wonder if a solution is to just spawn this widget prior, so the hitch doesn’t happen in the heat of combat.