Putting the DUH in HUD
Author: Devon Flynn
Posted on 6/13/2025
The Problem:
This week, I set my focus on making a clean player HUD layout and getting it linked to the player’s viewport. After spending quite a bit of time on the layout, I started my work in the PlayerCharacter script. My teammate who created the initial script for the player, left variables for the HUD class and HUD object for me to work with. These were incredibly helpful and saved me a few minutes of coding.
Unfortunately, when I linked the HUD to the player script through those variables, I could not get the HUD to show in the viewport. This issue took a great deal of my time, and eventually led to me re-writing the HUD section of the BeginPlay() function in the PlayerCharacter script. This however, was not the solution as it still did not display in the viewport.
The Solution:
After scouring the PlayerCharacter code line-by-line, I found the issue was a simple mistake when creating the initial HUDObject variable in the header file. Unfortunately, we had neglected to add the “class” prefix to the UPlayerHUD type. Since we did not have this forward declaration, the HUDObject variable was not able to use the class’s full definition. Once this forward declaration was in place, the player HUD was added to the viewport without any issues. Another of a long string of silly bugs that are comprised of a single word missing from the code, and making me feel foolish.
Zombats
Third-person Ability Shooter
Status | In development |
Authors | Wombat Studios, JRarrat, Josh The Dark, iWannaNuhh, aabunada, Flynn Studios |
Genre | Action |
Tags | 3D, Third-Person Shooter, Zombies |
More posts
- Camera Collision against Walls3 days ago
- Input, Sounds, Guns and Collision - Ben Bissett3 days ago
- AI Collision and Decorator behavior problems3 days ago
- The Journey to Multiplayer - Joshua Newton3 days ago
Leave a comment
Log in with itch.io to leave a comment.