do it like this
instead of first person character, use whatever blueprint youre using for your character. Instead of FirstPersonHUD, use whatever your default HUD class is (you can go to Edit > Project Settings > MapsAndModes to find out!). checking if its valid is unnecessary, and you definitely dont need to check it twice. If youre constantly changing hud classes in your game, then i suggest you use widget blueprints itll be a lot easier.