We have made a game, where we utilize a custom game instance class (made in blueprint), to store things such as music level, and graphics settings across levels. The project is setup to utilize the custom class, by defining it in the project settings:
. When performing casts to this custom game instance in any blueprint, everything seems to work fine when playing the game in the editor, or even as a standalone game. However, when packaging the game for shipping, the cast always fails. Is there anything that we are doing wrong, or is this simply a bug in the current version? A screenshot of one of the casts can be seen below:
So right after posting this question I figured it out. Apparently there is a bug with the DefaultEngine.ini not updating correctly if files are renamed. The project settings thus showed the correct file name, but DefaultEngine.ini linked to the old file name, thus causing the build to be incorrect. Manually editing the file fixed the issue.
Hi, I’ve tried every single answer I could find but nothing works. Whenever I play in editor the game instance works but when I launch on my android it doesn’t. Please help
Double massive thank you! My first level Blueprint casts to the game mode to set some variables, then spawns a camera and a bunch of other stuff, game would load, wrong camera, no HUD, figured out casting to my game mode was failing with a print string, found this thread, issue fixed, oh man, you are a life saver. Any word on this getting fixed? I had the same issue with 4.17
Thanks for posting this, I ran into the same issue with my project as well. Spent about 2 weeks trying to debug why my widget couldn’t communicate with my vrpawn when I packaged. This fixed it though!
I am having an issue with my game instance only in a packaged game also and this may have something to do with it, but I do not understand the fix on this thread. Do you simply change the file name of the Game Instance within the content browser of the Editor so it doesn’t read the game instance with the same name from an old project? Or is there an .ini edit that needs to be made?
Not just renamed, but moved. I moved my instance from one directory to another without renaming it, and it looks like it was pointing to the old directory.
Greetings, posting this here as i have stumbled about a similar problem like this, but for me the path was always correct in the DefaultEngine.ini
I actually had in the .uproject file of the project the LoadingPhase as PostEngineInit. Chaging this back to Default worked. Depending if the loading phase is important, i’d suggest trying the other options for LoadingPhase, that can be found in Unreal Documentation.
Hope this also helps whoever stumbles with this problem again. And sorry for bumping this, as i have not found this answer in any other threads related to this.