Unreal 5.2 - UMG widgets not being removed. Non-deterministic bug.

Hey there,

I’ve just updated my project from 5.0.3 to 5.2.0, and I’m noticing some weird issues related to widget creation and removing.

Looking through the code changes I’ve noticed there is a new “GameViewportSubsystem” that manages these widgets now, and I’m wondering if there is a bug stemming from that.

The issue I have is non-deterministic. Sometimes removing the widget works, sometimes it doesn’t, and I can’t reproduce it reliable unless I just keep triggering the creation+removal in-game. The behavior I had was working perfectly in 5.0.3, but unfortunately not any more in 5.2.0.

I’ve recorded a video here to demonstrate.

YouTube Link

The widgets I have are fairly complex and are created at different depths within my Blueprints.

Anyone have any idea?

1 Like

Hello, I have ran into this issue in 5.1-5.3 as well. This happens if a widget runs RemoveFromParent on itself during Construct, during the same frame. It causes the widget to stay on screen but it will also persist between levels. If the widget was created by another widget it will also cause that one to stay in memory as well.

Repro steps if Epic wants to make a bug report:

  • Make a UserWidget asset that runs RemoveFromParent on it’s Construct
  • Create the widget on LevelBP or anything else
  • Load a new level
  • Observe the widget still on screen
1 Like