Using multiple HUDs

Hi. I have a racing game and a HUD for menus, like high score, current time, lap etc. I used BP Time attack racer tutorial from Epic to do that. Also I have a HUD for my race car that shows speed, health, etc. What is the proper way to manage these huds and hide them/ unhide when needed? Thanks

Good question.

You could create a standalone actor that will act as a widget manager; use it for spawning, maintenance and keeping track of any active widgets. Keep a reference to this actor in the GameMode and you’ll have access to all your widgets, it can also serve as a hub for any inter-widget communication.

However, UE4 already has a class that is quite suitable for this purpose and gives you extra functionality not available anywhere else. And it’s actually called the HUD class. Before widgets were a thing, there was only the HUD class.

Player controller has direct access to it and since the PlayerController is available globally, so will be your widgets.