I create a UI when the Player enters a Box Trigger, and remove it when he leaves. The code works fine in a Level Blueprint. When I ported the code to a Blueprint Class, the UI is creaed as expected, but it isn’t removed.
In the Blueprint Class I even watched the Widget Reference value and it was set correctly, I also put a debug in the end, and the text was printed on screen, so it reached there.
Did you completely remove the creation of the blueprint in your level? If so, can you try creating the widget in the begin play instead of doing it every overlap? I suspect that the widget is created multiple times and added to the viewport. So when you remove it from parent, it only removes the last instance created.
Thanks for your answer. I actually just created one UI in the OverlapBegin, so I don’t think there’s more of them in the level.
Also, I created and remove them because the UI is specific to each region of the level.
Hey there, i would say that should work. Try checking if widget reference is valid on the overlap end, also try to set an owning player to the get player controller to see if it makes a difference.
I’m quite new to blueprints, how can I check if the reference is valid?
To the left of the sequence I’m getting the BP_Player, how do I set it to own the UI? (In the Level BP I’m not getting nor setting a Player and the remove works).