I’ve created some buttons using a widget blueprint to change the sun position in my level. I’m adding the widget to the viewport using my HUD blueprint.
The problem is: when i play the level some buttons turn gray, but they work normally. The strange thing is that each time that i play the buttons appear gray in a random way: sometimes is the first button, sometime the second, sometime two of them, sometimes all.
Hello,
i am not sure about your issue (not enough blueprint visibility) but it may be because you don’t use your widget but your hud. Try to disconnect your events in your hud, then check if you have your hover effect on each button and the grey effect (is it possibly a texture like hover which appears when it would not ?) If yes it may be the issue : check that you have all your textures set in your buttons and use “bind” to create an event in your widget and set your events there instead of your hud.
I don’t know why you bind your buttons from the HUD BP, but you can create your widget from the HUD and bind every single button on your widget with 3 OnClicked Events.
Thanks for the reply Fen! My event can happen only in the Level Blueprint (Change sun position). So you are saying to add the widget to viewport using Level Blueprint, not the HUD?
Also, im binding the buttons in the Widget and using it to cast to HUD.
Widget button cast to HUD, then in the HUD i detect the event and send a command to my Level Blueprint using an Interface BP. Finally, in the level blueprint i take the function from Interface BP and start a Change Sun position.