Why does my main menu widget disappear after ive packaged the game but works in editor (GameInstance not loading)

Gday,

I have the main menu in my game that works fine in the editor however after I’ve built the game it doesn’t appear even though I’ve set the camera that the player is supposed to possess upon opening the games .exe file. I have the main menu become attached upon the BeginPlay event which works in the editor but not within the build which possesses the pawn that only has a camera on it but doesn’t create the main menu widget.

For the packaging settings, its set to shipping and I have it doing a Full Rebuild when packaging but I am unsure that is the reason as its only today I have encountered this issue

Edit: Could it possibly be that the player doesnt possess the player pawn until the after the levels Begin Play has executed?

How are you creating your menus? Is the correct level set in the project settings(DefaultGameMap)? What camera are you possessing? Is there a specific reason / art of gameplay involved? E.g. for creating a MainMenu you could create an empty level and create the widget in the level blueprint.

So i have a level called MainMenuLevel that is set as the Game Default Map, the Pawn (that just has a camera attached) is within that level

inside the level attached to the begin play I have it create a main game level widget like this, this works fine within editor

as soon as i package it doesnt work

Looks like you have some branching going on in the upper part of blueprint(which is not seen).

What does your Pawn actually do in the MainMenu?

My pawn within the MainMenu simply gets AutoPossesed by the player, the Pawn itself is attached to a level sequencer that simply makes it spin. I have several Pawns that the player switches in between in the different areas of this map. All of which has different widgets but those work fine when the main menu widget is functioning, which it currently is not even being added in the build for whatever reason but the player is able to get AutoPossesed.

This is how it works, on begin play it gets the values from the GameInstance (Brobdingnagian) which basically are just branch checks whether the player won, lost, or went out of bounds and then goes to each pawns camera accordingly that are placed around the MainMenuLevel. If none of these is true then it will simply go to the MainMenuCamera (which gets auto possessed) and then simply displays that MainMenu widget.

The big problem when packaging the project is that the player auto possesses the correct pawn and can see through the camera, however, the level blueprints BeginPlay either doesn’t fire or is out of order with the entire game. I have also attempted doing the same with the Possessed event and the Begin Play in the MainMenuPawn blueprint.

^ here is the blue print

Does any of the sounds trigger that are set to play in this blueprint?

So, you could try to use just the standard pawn (no selfmade) and just place camera actors and use those with SetViewTargetWithBlend (I think). Next you could check if your widgets are referenced (right click in content browser). You could check if all necessary files are included when packaging (project settings - packaging - ListOfMapsToInclude).

yeez the main menu theme

Try to start it in editor in standalone mode.

in editor standalone mode it creates the window and the widget but i cant actually get it into focus, i can control it and everything but its just pushed all the way back and basically only exists when you can look at the windows when alt+tabbing

Can you upload your project?

i’d prefer not to,

i do have a custom game mode for the level could it be that?

image

Try with allow tick before begin play checked and player controller class as default player controller.

I enabled the Allow tick and that didnt work as well as setting the GameMode override to none and nothing changed :confused:

Does it work when you disconnect all connections and just create the MainMenuWidget?
Did you try a blank project with just a menu and package this?
Did you look at the outputlog?
And could you tell us the sequence of events you want to happen, what the player should be able to, etc.

Huh just making the Widget displays it in the build, yall reckon it could be the game instance not being created in time?

Now, after CreateWidget, do one of your SetViewTargetWithBlend. If this works, do all of this after the CastToGameInstance. After that, one branch, do check if you can get a variable from your GameInstance. If this works, try to add your sound. And so on :slight_smile:

Ok I have figured out that the GameInstance Brobdingnagian is not being created in the packaged project but does work in editor