When I click one of the 2 buttons, the other one get invisible. But the first button is leaving an imprint/ghost when I click it. The second one seems to be working fine. I just set its visibility to hidden, but I can’t do that for the first one as there wont be anything to click then.
I want only 1 button to be there, but move to another location when it’s clicked and the sidebar is visible. when the sidebar get’s hidden, move to default position.
but this is also leaving an imprint. Just like the previous one. the repositioning is working fine, but the imprint is something I am unable to get rid of.
Are you sure it’s the same button and not an accidental copy? Maybe recheck the hierarchy for any widgets that shouldn’t be there. To be 100% sure, you can go to Tools->Debug->Widget Reflector, select Pick Painted Widgets, and hover over the “imprint” to see what it belongs to.
I am very sure that it’s not a copy. also It’s not clickable as well after the event happens for the first button to disappear.
it’s for a sidebar. When I click openSidebar, that button should disappear and closeSidebar botton should be visible. It’s working the other way around, just the OpenSidebar button never seems to disappear completely. seems like it’s leaving a shadow behind.
Well this is a weird situation… the tool shows that both your Sidebar and ToggleOpen are visible, and ToggleClose is hidden, which makes no sense given the blueprint logic and video. And it doesn’t seem to show any duplicate widgets or other weirdness.
Here’s a weird checklist:
Is there any other logic in your widget BP that might be affecting this?
If you click on the Open button in the designer, look at details, and switch on Modified Only (on the cog icon) do you see any unusual changes from the defaults?
Could you temporarily hide or delete the Open button in the designer and check the behavior? Is there anything showing in game with the button deleted? If not, maybe recreating the button fixes the issue.
If I delete the button, there’s nothing there (as expected). Hiding it does the same.
I checked all the properties. There is nothing unusual. Only the appearance properties are changed.
The only difference between the 2 buttons is the position X & that the Open button is set to Visible while the Close button is set to hidden - in the Visibility option under Behaviour section. Everything is exact same.
Funny thing, If I set the Visibility of the Close button to Visible, its also doing the same thing.
I found another weird thing. There is a Border (name - Sidebar Panel) containing these elements (refer attached image). If I put the buttons out of the Border (Not in the hierarchy, but in the design), they behave even more weirdly. Look below, Watch full video, and try to understand the behaviour -
The close button can disappear just after one click, only if the the Open button is visible. If it’s hidden, I’d have to click two times to make the Close button disappear. It’s kinda hard to explain just watch the attached video again please.
I think I finally understand what’s happening here! You have 2 CharacterSelectionUIs overlayed on top of each other! Check your UI spawning code and report back please.
This also explains the new behavior with “outside of border” buttons, you have 4 clickable buttons instead of 2 because previously the border consumed the input after you opened it by clicking on the first button.
Hey! Thanks Man! Apparently I was calling the UI twice.
Well! I disconnected the Event BeginPlay in MyGameMode and it worked, But I am concerned if the project will fall apart without that connection. Can I have a blank Blueprint in the GameMode?
I mean, it’s hard to say which of the two UI-spawning calls is extra, you’ll probably have to figure that out on your own. If your game has multiple levels and you need this UI in all of them, it’d be better to spawn it in one of the classes that’s shared between the levels (for example your GameMode, if it is indeed common to multiple levels).
Either way, when you pick which one is staying, just remove the nodes that are obviously duplicated (CreateXWidget, AddToViewport, etc.) from the other one and you should be good to go.
As for the “blank” BP, I’m not sure what you mean exactly. The graph can have no logic if that’s what you’re asking.