Hi,
I’ve spent a lot of time messing around with Common UI and I was having an issue with the CommonActivatableWidgetSwitcher (CAWS). There’s not great documentation or support for Common UI yet so I wanted to share what I learned here to help anyone having this issue in the future…
THE ISSUE
I was using the CAWS in my UI to switch between screens (Inventory, Map, Settings etc.). However, I noticed that in some cases after switching the new widget wasn’t becoming active and for Gamepad in particular this would mean you get stuck (no way to exit, none of the buttons work). Furthermore, widgets with no buttons on them at all to focus on also cause the same issue. It’s not clear if this is a bug or intended behavior (I’m in UE5.2) but switching a widget in this way which is meant to activate the next widget seems more like a bug if it doesn’t actually activate and properly set focus.
THE SOLUTION
By default, the CAWS has a 0.4 transition duration to give a nice fade effect. This causes an issue where the new widget doesn’t always set focus. If you don’t need the transition effect, setting the transition duration to 0 will likely fix it as it correctly sets focus. This can be found in the Details panel of the CAWS.
If you want a transition duration, you can run a delay after calling the activation function (i.e. Activate Next Widget) for the same length or a little longer than the transition duration and then using Set Focus on the relevant button or object on your widget that you want to put focus on.
Lastly, activating a widget with no buttons on doesn’t seem to work with Gamepad as it has nothing to set focus too and therefore the Gamepad stops working and you get stuck on the screen with no way out without using the mouse. You can solve this by adding a button and making all of the alpha in the Tint for Normal, Hovered, Pressed, Disabled to 0. Ensure the button Is Focusable = True and Enabled = True.
If you’re seeing a blue border around your invisible button, go to Project Settings / Engine - User Interface and change ‘Render Focus Rule’ to Never and that should remove it.
I hope this is helpful for anyone having this issue.
Thanks!