PlayerCharacter not spawning in Mobile Preview (PIE), but does spawn in Selected Viewport (PIE).

Hi there.

I am having trouble trying to test an Unreal Engine 4 project on the Mobile Preview (PIE). When the level is opened in-game, it does not spawn the PlayerCharacter.

However, the PlayerCharacter does spawn in Selected Viewport (PIE) when the level is opened in-game.

I have the PlayerCharacter set in the GameMode which is what is supposed to spawn it into the level automatically. PlayerStart is referring to the correct gamemode as well.

On mobile, and through the PIE, can I rely on the GameMode to spawn the PlayerCharacter into the level? Because currently it would seem that I cannot trust it to do the task.

Are there any other settings required to ensure that the PlayerCharacter gets spawned into the level? (other than putting blueprint nodes in the Level Blueprint to ensure it gets spawned).

I need to be able to rely on the GameMode, as when I switch out to another level later on and then switch back, the GameMode is what needs to spawn the PlayerCharacter into the level.

Is my understanding that GameMode is capable of spawning the PlayerCharacter automatically for mobile, or packaged games correct?

Any help or guidance in this matter is greatly appreciated :slight_smile:

Engine version: 4.10.4
Project: Blueprint-based
Editor running on: Windows 10 or OS X El Capitan

EDIT: To add to this post, I also notice these warnings when running level in the editor. Should any of these be a cause for concern?

LogPhysics:Warning: AddConvexElemsToRigidActor: [/Game/Assets/Map_assets/S_map_1.S_map_1] ConvexElem[0] invalid
LogWorld: Bringing World /Game/Maps/UEDPIE_0_User_Village_map.User_Village_map up for play (max tick rate 0) at 2016.04.03-18.23.06
LogActor:Warning: GameSession /Game/Maps/UEDPIE_0_User_Village_map.User_Village_map:PersistentLevel.GameSession_3 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
LogActor:Warning: GameNetworkManager /Game/Maps/UEDPIE_0_User_Village_map.User_Village_map:PersistentLevel.GameNetworkManager_3 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
LogWorld: Bringing up level for play took: 0.002896
LogVoice:Warning: Failed to initialize voice interface
LogSpawn:Warning: SpawnActor failed because no class was specified
LogOnline:Warning: NULL: Can't start an online game for session (Game) that hasn't been created

It looks like the underlying issue may be deeper than I thought. When running the Mobile Preview (PIE), UE4CrashReport appears momentarily on the Mac dock. Does this Crash Reporter store it’s logs locally? I can’t seem to find it anywhere in the Engine folder under Saved.

Is there a way to debug the Mobile Preview (PIE)? Currently, I only have print text nodes to get an idea of what’s happening during Mobile Preview (PIE) run.

I’m seriously struggling trying to figure out why this game crashes. On Android through the Android Device Monitor, I get this warning just before it crashes:

[2016.04.03-05.05.34:657]  0]LogLinker:Warning: CreateImport: Failed to load Outer for resource 'WidgetTree': WidgetBlueprint /Script/UMGEditor.Default__WidgetBlueprint

If anyone could kindly guide me on current debugging practices for a game that crashes only when running outside of the editor’s Selected Viewport (PIE) I would be very grateful!

I’ve come to a point where I think I’ve solved my issue, but this is not a certain thing yet due to the nature of how I fixed it.

I believe this project was initially developed on Unreal Engine 4.9, and was then upgraded to 4.10.1. When it reached me, it was upgraded again to 4.10.4.

I believe under the hood, the engine is not able to bring references to certain things properly over multiple engine versions. This was apparent with the structs present in the project, which would always complain with errors during runtime, build or cooking on any device despite the structs being referenced properly in the blueprints. They did not complain during Selected Viewport (PIE). To fix those errors, the references were deleted and remade again identically in 4.10.4 and now the engine no longer complains.

An example of the struct errors during cooking:

LogProperty:Error: UStructProperty::Serialise Loading: Property 'StructProperty /Game/Blueprints/Mode/Mode_Character.Mode_Character_C:MainStruc'. Unknown structure.

So, I attempted something similar with the PlayerCharacter class. I duplicated it in the Content Browser as a backup precaution, and then renamed the original class. This forced the engine to re-save any references to this class. I did a Build, and then Save and Save All. I then renamed the PlayerCharacter class back to the original name. The engine re-saved any references again to this class. Now, the PlayerCharacter always spawns as expected when the engine loads into the level both inside the Selected Viewport (PIE) and on actual devices (Mac OS X, Android, iOS).