Widget Button Blinking When Cursor Hovers Over it
Ok so I am trying to make it so when you click on an object, a little quiz pops up. I am making the quiz work by swapping the buttons and images when you click the buttons so I don't have to make a bunch of widgets. Although I haven't gotten very far because the first button sometimes works and most of the time doesn't. I press play and sometimes it works like a button. I press play and most of the time it blinks while I am hovering over it, making it impossible to click it. But still clickable if you click at the right time.
So I will have 2 images. One is showing how I made it so I can click on actors and the other is how I am making the quiz widgets showing up. The code in these images are in the level blueprint.
I have tried swapping out the widget with a widget that works and I still run into the same problem so I am pretty sure it is not the widget itself. Maybe I should use a Remove Parent node instead of a Remove All Widgets node but I don't know what the target would be. How to call the current widget to remove it. And I think they are the same but I am not sure.
Anyways how do I make it so I can click on an object, a widget pops up creating a quiz with buttons that can be clicked?
asked Dec 11 '18 at 08:35 PM in Blueprint Scripting
Ok so I figure it out. Boy do I feel dumb, the event tick was constantly firing the widget so thats why it was blinking. There was a constant stream of widget creations.
So I fixed it by adding a gate of sorts so that the constant firing will stop effecting the widget. I am sure there is a better way of doing this but what I did was I made a boolean variable to be stored in the character blueprint. Then When I left clicked something, the variable would be true but only for a split second. That gives the code enough time to go through the other parts. Which is if what you click is the first aid object and the boolean I made was true then the widget will come online. And since the boolean will only be true for a split second, only 1 quiz will be online. Instead of a constant stream of re-creating the quiz. Check the images for more clarity.
answered Dec 12 '18 at 07:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here