I’m currently trying to learn how to add a HUD to my characters viewport but for some reason, the widget doesn’t show up when I play. I’ve looked up similar problems but most of them have to do with adding the GUI to the game mode which I have already done. I’ve uploaded images relative to the subject here including game mode settings, widget layout, and the HUD nodes:
I don’t know if you have solved your issue yet, however, I discovered a similar problem when I attempted to complete the HUD portion of the first person shooter tutorial in the UE4 documentation. The crosshair that I added to the game, following the instructions, would not show up when I tested the game in PIE (Play in Editor) mode. I decided to run it in standalone game mode per someone’s suggestion and it finally showed up. I’m still not sure why it does not show up in PIE mode.
You create your Widget inside of the GameModeBP if I can see this correctly ? Sorry, i tried zooming into the screenshots, but I can’t see it properly ^^ Have you tried creating the widget inside your actual PlayerCharacterBP? That’s where i would put it.
Just try to copy and paste the whole create widget nodes into your PlayerCharacter. See if that works.
the same with me, I am creating the widget in the character but no value is returning or add to the viewport and whats worse is mine is crashing on it, I got a feeling its a bug
In case you haven’t found a solution yet, or if someone else is in need:
If you can get your widget to show at all in the viewport try calling it from the level blueprint instead of the HUD Blueprint like so:
Hi guys, i had the same issue and i found out that selected Viewport don’t run the Game Mode Preferences so it never goes to our HUD and never creates our Widget.
This don’t happen on Standalone because Standalone reads the Game Mode in Initialization.
If you want to test on default viewport to get it faster you may do it like this:
On your playerBP → Event Begin Play → Client Set HUD