When a project with a C++ custom game instance is packaged for Android, the game mode is initialized twice from different paths.
Device log files attached
1. Open UE4Editor
2. Create a code based project
3. Add Code to Project -> New Game Mode
4. In the header file add the following code to the generated body:
UMyGameInstance(const FObjectInitializer & PCIP);
5. In the source file add the following construtor:
UMyGameInstance::UMyGameInstance(const FObjectInitializer & PCIP) : Super(PCIP) { UE_LOG(LogTemp, Log, TEXT("Initializing InventoryDB from GameInstance path '%s'"), *GetPathName()); }
6. Compile the project and open
7. Package the project for Android
8. Launch the project on the Android device
Result:
Device logs shows the line from the constructor being generated twice
Head over to the existing Questions & Answers thread and let us know what's up.
| 0 |
| Component | UE - Gameplay |
|---|---|
| Affects Versions | 4.6.1 |
| Target Fix | 4.8 |
| Created | Feb 11, 2015 |
|---|---|
| Resolved | Feb 19, 2015 |
| Updated | Sep 16, 2019 |