Possibly a bug or ConstructorHelpers misuse?
I have such code in MyGameMode.cpp constructor
It has two static ConstructorHelpers variables, which got reset to null in packaged build. I run my game, load level, init character based on var in singleton. It works ok. But after finishing the level and reloading it all the same code sets None to DefaultPawnClass.
This bug only appears in packaged build. everything works ok in Unreal Editor.
I have this levels StartGame.umap -> CharacterSelect.umap as sublevel
LevelLoader.umap -> BigGameMap.umap as sublevel
sublevel are loaded using level streaming. Bug occurs after I do OpenLevel(LevelLoader) in my blueprint after playing on BigGameMap.
trying use not static ConstructorHelpers, hope it fixes the error.
Crash occurs in AGameMode::ChoosePlayerStart_Implementation
Upd: Removing static fixes the crash. Moving ConstructorHelpers out of the switch, to the beginning of the function also fixes the crash.
Thanks for the sample project and additional clarification. I was able to reproduce what I believe is the issue you described. I did not see any problems the second time the level was loaded, but after several attempts reloading the level, it eventually crashed. Re-running the project and reloading the level multiple times again resulted in the same results.
It looks like what may be happening is that
You want to add that line inside the
answered Oct 27 '15 at 09:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here