I’m a programmer by profession but new to game programming. My exposure to Unreal Engine is limited to watching some tutorials and video courses on Oreilly and Udemy, and I’ve focused on Blueprints for now rather than C++. I’m having trouble with the first basic game I’m trying to build.
I’ve started out with the First Person Shooter template, and added a few cubes and other objects (like chairs and tables from the Starter Content). Each object is a mesh inside a Blueprint with Physics and Collision. The goal is to shoot all the objects outside the game area. I’ve done this by creating a Trigger Volume encompassing the game area and counting the number of actors that leave the volume.
I store the number of actors in the level by using the “Get All Actors of Class” node, and setting length+1 in a variable in the level.
The number of actors that have been shot out are also counted in a Level variable. I am also able to print both using “Print String”.
I now want to display both the total and the eliminated count on a HUD, however I can’t seem to figure out how to access Level variables in the HUD.
Is the Level the right place to count these things? The tutorials I’ve seen seem to use the Character blueprint instead. But while the actors shot out could be counted in the Character BP, the total count of actors should probably live somewhere else.
So my question: Is there a way to get the level variables to show up in the HUD? Or am I approaching this the wrong way?