So what am I trying to do is implement a main menu for my game where on clicking the new game button would start the game… the steps I followed:
- Made an abstract class for UI (Base UI)
- Making child from it - Main Menu Widget
- On the Player Controller: its holding the ref to the Main Menu widget
- Also I am making a delegate to broadcast signals between the controller and the widget
- On the Game Mode: in the Post Login Function I am creating the widget and adding it to the viewport
- Also in there, I am adding a listener to listen to the buttons on the main menu widget.
- On Clicking the new game button, the UI would disappear and the game would start.
Now the problem:
It is successfully adding the UI to the viewport when the game starts but does not hide it