my widgets are conflicting what should i do

I showed it with pictures, friends, I click on about, then I press the back buttons, this time the about widget stays behind and does not close.what should I do?




Keep a reference to the about widget after it spawns (promote to variable). To get rid of it call “remove from parent” on the saved reference variable once it holds the widget.

sir can you give an example as ss i am new but i don’t understand what you mean :slight_smile:

I’ll try to prepare a mini project to show the workflow.

1 Like

Hey there @DemirYapim! Quick example of what Raven was saying. So when you create the widget, you can drag off it’s return value and click promote to variable and this makes it a variable inside your script. This variable is a direct reference to that UI element. You can destroy it (remove from parent) when you want to get rid of it.

menus.zip (66.9 KB)

incorporated the widget switcher to swap out the menus

There is an outer widget that holds the switcher
inside the sub widgets they can access the outer widget and change it’s current index on button press.

Sub widgets derive from a common class that has access to the outer widget.

How to set the index of the widget we want to go to?

You can set it referencing the switcher (it’s already set in the common widget class).

Take a look at the sub menu button on click action.

You can add widgets to the switcher by dragging them in. You can also add them via blueprint actions add child and as the target setting the switcher component.

You can of course add and remove widgets by hand with spawning them using and “add to viewport” or remove with “remove from parent” but it will be hard to keep track of with more complex menus.

Sir, I took a video, where am I doing wrong?
Uploading: 20230117_164913.mp4…

I think the upload of the video failed. The link seems broken.

https://drive.google.com/file/d/1PI_nvpBqwJPCzmUQ-93lkpDA1ZLoEsD1/view?usp=sharing

I downloaded the driver, you can check

Promoting to variable isn’t enough.

You need to restructure your canvas.
Have a main widget which has the switcher component dragged into the canvas.

Inside the switcher you need to drop your menu widgets (so main menu, about etc.) and they have to be indented under the switcher.

Then you need to make the switcher a variable, then you can reference it when clicking a button.

Just promoting to variable results in an empty initialized variable causing errors.

@3dRaven @SupportiveEntity Thanks for everything guys, I’ve arranged everything, good luck :heart:

1 Like

can you look at my question :slight_smile:
https://forums.unrealengine.com/t/i-made-a-chat-system-and-when-i-press-the-p-button-on-the-computer-the-chat-opens-how-can-i-turn-it-into-a-button-for-mobile/752035