C++ HUD Not Drawing
I am going through the video tutorials found here: https://wiki.unrealengine.com/Introduction_to_UE4_Programming_-_1_-_Overview to learn how c++ can be incorporated with blueprints. I ran into a snag at the very end of the series, on drawing the HUD that shows the score. Below is some of my relevant code: GameMode Initialization:
And my DrawHUD function:
But when I play the game, the logging at the top of my DrawHUD function never shows up, so I know this function isn't being called. Finally, here is a screen shot of my Default Modes section of the Project Settings. According to this, the correct class is specified as the HUD class for my project. Let me know if any more information would be helpful to diagnosing the problem.
asked Jun 16 '15 at 04:12 PM in C++ Programming
So I tried out your code:
y TestHud.h // Fill out your copyright notice in the Description page of Project Settings.
my TestHud.cpp // Fill out your copyright notice in the Description page of Project Settings.
And this works for me (I commented out lines which referred to classes that I did not have). I get a log spammed with:
However, though since ATestHud::HudFont was never set, nothing is drawn.
heck that you've not overridden the gamemode in world settings:
Sorry to hear about your problem. This behavior may occur in the situation when
Hope this helped!
answered Jun 18 '15 at 04:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here