On my player controller I have a timer that the player need to move from place A to B. If the timer end, player loses. When the timer end it sets an event that that add widget to screen.
Im trying to add an extra life button on that widget.( I got that part done)
The problem im have is that when I click the button, which is connected to [create widget] then to [remove from parent], the widget will not go away. I’ve tryed promoting a variable, But nothing.
When you click the button, you do not want to choose “create widget” because that will create another one. It should just be remove from parent with the self pin plugged in. If that’s not working, store the created widget in the player controller as a variable after you create it, then in the widget, at the end of the in click event , get player controller - cast to (your player controller class) - get the widget variable, and then plug that variable into “remove from parent”. If that’s not working, check your logic and make sure you’re not creating and adding it to the viewport more than once