How to Hide/Show Analogue Sticks with C++

I am going to Hide my Analogue Sticks UI when player enter weapon shop in my mobile game,
And show Analogue Sticks UI when player exit weapon shop,
How can I set Analogue Sticks UI Hide/Show with C++,
Thanks.

Are you referring to the SVirtualJoystick? To hide it, you will have to get a hold of the widget instance for the sticks. You can then set the visibility to hidden on it.

It would look kinda of like this:

SAssignNew(MyJoystick, SVirtualJoystick)
...
MyJoystick->SetVisibility(EVisibility::Hidden);

Is this possible with blueprints? My question here was closed, but pertains to blueprints rather than c++.

EDIT: To achieve this with blueprints, I created a touch interface with 0 elements, and a touch interface with the desired thumbstick elements. the player controller has a function ‘Activate Touch Interface’ which makes it really easy to toggle between whatever interfaces you want.