Player controller messed up after packaging

Soooo I have a Main Menu map with nothing but a level blueprint nodes added.


(It’s a parody game i’m just exploring the engine for fun)
When i play it in PIE it successfully draws my hud and prints “PlayerController_0”.
But when i launch .exe there is no hud showing and the string says “PlayerController_2147482556”
I know that there is only handlers for 8 players in the engine but what is the problem?

Try creating your HUD and add to viewport through a custom event in the game instance. I had trouble calling it from the player controller in multiplayer. If it needs to come up on the main menu you can call it from the level blueprint. I know that works on multiplayer

What stands for game instance? By the way i not imply any multiplayer.

The game instance is like the king blueprint. It persists as long as the game is open and will maintain any variables you set inside it throughout all levels.

If you haven’t made a custom one the engine creates one by default. You can create a custom instance by making a new blueprint class called game instance and name it something like “YourProjectNameGameInstance”.

In your project settings find your default game instance and set it to the one you just created. You need to make sure its set the same in your game mode settings also.

Its a good place to set up menus, widgets and your HUD through custom events. So you would make a custom event and call it perhaps “ShowHUD” > create widget> select the hud class you want. GetPlayerController and connect it to owning player controller. Then promote it to a variable and call it “HudRef” then > add to viewport.

From your main menu level blueprint cast to your newly created game instance > GetGameInstance and connect it to the object and the drag off the cast and find your custom event called “ShowHUD” and then when the main menu map opens your hud should display.

You can use the variable you promoted to a variable in the instance to do other things in other places with it. Like hiding it or removing it from parent and such.

So i decided to gather some additional info for debugging. Now it prints PlayerController name, Game Instance name, Game Mode name and Camera Manager name.
And this is output from .exe
image
If the game launched from engine all digits that begins on 2 replaced with 0. I can load and play any map.
Actually game doesn’t work at all, it even broke the ThirdPersonExampleMap from the preset i used. And I can’t even track what i did before this disaster. I really appreciate your help but i think I have something more than blank hud error.


This is log from visual studio (Project is blueprint based I used VS for debugging).
MainMenu_2 can be replaced with any other map as I change startup map in maps and modes settings.

Look. So i checked my packaging settings for 101st time and compared it to new template project. I set it all like in reference. All i changed was Target platform from “Android” to " " and staging directory “D:/WindowsNoEditor/” to " ". Now everything works like before the disaster. :partying_face: