Download

Removing 2 widgets when leaving a collisionbox

Hi there,

I’m relative new to the Unreal engine and still learning. Blueprint scripting was going really well up to this point.
I need to remove 2 widgets when leaving a box collision, however with the blueprint in the screenshot only the first widget (so the Interact_m) gets removed. What am I doing wrong?

Any help is greatly appreciated!

Because уou removed the first widget and unset other widget which will be invalid in sequence. Your second widget will never be valid if you unset it in previous sequence.

Thanks, makes sense. However what would be a alternative to get the two widgets removed?

Maybe create your main widget from the HUD class and create references. You can always call it like this: get player controller -> get HUD -> cast to your HUD class and hide/remove/add widgets.
It all depends how you envisioned what the game looks like and what functionality the widgets have.
For example, I would create a new widget for Signs/Interaction, add it to Main Widget as User Created widgets and by default set it as Hidden/Collapsed. When you want to show interaction widget you can simply call reference of main widget -> Sign/Interaction widget and set visibility to visible (or hidden when player leaving a box collision).

What they’re saying is get rid of this bit and it will work:

bit.JPG