Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Casting to game instance always fails when packaging the game


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: Project settings showing game instance set to globalscope. 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: Casting to globalscope in a blueprint class

Product Version: UE 4.15
more ▼

asked May 01 '17 at 08:53 PM in Packaging & Deployment

avatar image

76 3 7 14

avatar image ToxicAbyss Jun 27 '17 at 01:16 PM

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 :/

avatar image ToxicAbyss Jun 27 '17 at 08:01 PM

Never mind it turns out the .ini was missing a sub folder where the game instance was placed >__>

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered May 01 '17 at 08:59 PM

avatar image

76 3 7 14

avatar image CaptainCorrection May 19 '17 at 08:11 AM

Massive thank you for posting this, wasted so much time trying to work out what was wrong with our game. What an irritating bug with UE4.

avatar image SkimpKillah Aug 13 '17 at 06:43 AM

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

avatar image BryanChrisBrown Oct 31 '17 at 03:28 PM

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!

avatar image kurtisaurus Sep 07 '18 at 08:53 PM

Thanks you so much for this! It was making me crazy.

avatar image Threshold Seven Jan 11 '19 at 07:21 PM

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?

avatar image Barksie Jan 22 '19 at 08:13 PM

What a find! - Thankyou. - (4.20 project)

avatar image Yashinski Mar 07 '19 at 08:46 AM

Real life saver ♥ I've spent half a day trying to solve this issue!

(comments are locked)
10|2000 characters needed characters left

Bumping this because this bug still exists in 4.20

more ▼

answered Nov 10 '18 at 09:15 AM

avatar image

81 5 7 10

(comments are locked)
10|2000 characters needed characters left

You're a f** hero for posting this....Thank you...

more ▼

answered Jan 29 '18 at 05:05 PM

avatar image

6 2

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question