HUD missing in package

Hi,

I’ve made a custom HUD and this works fine when previewing in the editor (it’s called IntroHUD).

In project settings I’ve set HUDClass to “IntroHUD”

Under game mode (World Override & Project Settings) I’ve set HUD to “IntroHUD”

When I package the content up and run the EXE though, the HUD is never displayed.

Does anyone know why, or what I can do to fix this?

Many thanks,

Could it be that it is not the hud but the GameMode that is not getting packaged? In the log after the level has been loaded it should print out which GameMode has been spawned. If it’s not yours you have some ways of adding a GameMode to a level, either by hand adding a reference into the WorldSettings of the level or setting up a lookup that will match the actual level name. The later is the most flexible way of making sure your mode is cooked (give me a sec and I’ll post an example case).

let’s say you have a deathatch game mode that needs to be set for every DeathMatch map in your game, so you would add it by hand to each map or you could tell the engine to add it automatically if the map name matches. To do that just go into your DefaultGame.ini file and add the following values (of course use the reference for your own game mode and prefixes).


[/Script/Engine.WorldSettings]
+DefaultMapPrefixes=(Prefix="Entry_", GameMode="/Game/Blueprints/Modes/BP_MyEntryGameModeBP.MyEntryGameMode_C")
+DefaultMapPrefixes=(Prefix="DM_", GameMode="/Game/Blueprints/Modes/BP_MyDeathMatchGameModeBP.MyDeathMatchGameMode_C")

[/Script/Engine.GameMode]
+GameModeClassAliases=(ShortName="Entry",GameClassName="/Game/Blueprints/Modes/BP_MyEntryGameModeBP.MyEntryGameMode_C")
+GameModeClassAliases=(ShortName="DM",GameClassName="/Game/Blueprints/Modes/BP_MyDeathMatchGameModeBP.MyDeathMatchGameMode_C")

As you can see we just created a link between a level prefix and a game mode, we also added some aliases to be able to refer to the mode easily. The aliases are used to change a game mode when you travel, so instead of using ‘?game=/Game/Blueprints/Modes/MyDeathMatchGameModeBP.MyDeathMatchGameModeBP_C’ you can now use ‘?game=DM’.

Thanks!

It turned out I need to go into the blueprint for my actual game mode and also set it in there - the one place it seemed not be set! It now gets packaged and works fine.

I do seem to be missing some textures from my package on some objects though… Any idea what would cause this?

Many thanks,

It’s normally always a problem of referencing the assets, if you add hard references directly it should work but if you use just a simple string the cooker won’t now what to add to your game. There are several ways to get them working but first check how are you referencing those assets that seamed to fail.

Check the documentation about what are the possible ways to reference an asset and how to load it in an async manner in case you need it.

Thanks so much for the assistance Moss.

Should any future people search, find this and have a similar problem…

It actually turned out that the materials need to have ticked:

Used with static lighting
Used with instanced static meshes

:smiley: nice I was of help!