What am I doing wrong I have a button the opens up a widget I want it so if you click the same button again it removes the widget but its not doing please someone help me I am so confused to what I am doing wrong.
Thanks
Ryan
What am I doing wrong I have a button the opens up a widget I want it so if you click the same button again it removes the widget but its not doing please someone help me I am so confused to what I am doing wrong.
Thanks
Ryan
You’re using the wrong variable. No need to create another one. You already have the 2d-3d. See my pic again.
That is just the button but I can not get a set option just a get option when i drag it in
If the top bit is the widget you add, the bottom bit should be the widget you remove. Do not remove the 2d-3d if that’s the button (which I can now see on the event node - my bad).
Remove the same widget you created and referenced. It’d be close to:
And here’s a version of the above that creates the widget only once:
Rather than re-create it from scratch every time we click. You can get of the Validated Get
node by right mouse clicking the regular Get
node:
There’s some confusion here.
Note that my script above does not say 2d-3d button anywhere.
I think it adds to the confusion that you’ve called the SitePlan
widget 2d-3d widget
. Perhaps that variable should be called 2dSitePlan
- just to make things clear.
However, the script looks OK to me. Does it not work?
Currently when i click on the “2d-3d” button in the ui the image comes up but then when i click it again it does not remove it from the ui
Thanks
this helps clear up
All of this looks fine now.
Can you see the button go down when clicking the 2d time? What are the chances the newly added SitePlan
is full-screen and covers the button, preventing the 2nd click?
Select this node and hit F9 - it will add a breakbpoint (you can remove it the same way):
Run the project, the script should terminate when it hits that spot - does it?
i tried that but the project did not stop when i did this. the way I am making the button appear is adding it to another ui , I am wondering if your right but i do here the click sound i have added when i keep clicking it
I see. I guess you’re creating instances of this widget and things get lost in the process. How do you add the button widget?
Add a Print String at the end:
rIt should fire only once. If you see it fire (print) more times, it means we create more buttons than is needed - and that’s providing I understood what is going on.
every time i click the button it prints once , The ui button/bar come in and then the image below
Then we have the issue with the button itself. Most likely with the way it is added and / or removed.
You could test the above script by copy / pasting it into the level blueprint (and adding the vars) and using any keyboard key as input. Once you know this part is working as intended (the widget pop up and hides), you can start looking into why it does not work when invoked by the 2d-3d button.
Sadly, we do know enough about how things are organised.
Thanks I will have a try and come back
this is what comes up
Here’s the flow for the suggested script:
FlipFlop
the now existing widget between two Visibility
statesHard to tell what else is going without knowing the rest of the setup. I’d investigate this part:
the way I am making the button appear is adding it to another ui
I believe (a wild guess!) you keep adding new buttons and orphan the widgets created with the script we see. Count them:
See what you get. If you get more than 1, then it’s what I think it is.
Every click the number goes up by 1 from 1