Forum rules - please read before posting.

Cameras not saved on iPad

I've added constantID scripts to all my cameras, but for some reason when saving games on the iPad the cameras are stuck and won't follow the player when loading a game on the iPad.

This doesn't happen when I'm playing the game in the editor.

Does anyone have any advice on how to troubleshoot this issue? Can anyone reproduce this?

I'm running Unity 5.1.2f1/ AC 1.47/ Xcode 7.0 and iPad mini 1 with iOS 9.

Comments

  • Details on how to find the log files for iOS builds can be found here.  Please let me know if you find anything of note there, as I can't reproduce this.

    Are cameras the only thing that don't get saved?  Is the player's position restored correctly, for example?

    I also need a bit more detail into the problem itself.  How do you mean they're stuck?  Is the correct camera made active, at least?
  • edited September 2015
    Thanks for your reply, Chris. The log file from xcode does not seem to contain any errors. 

    The GameCamera2D is set as the default camera that follows the player.

    image

    The player's position is saved and everything else seems to be in order. It's just that the camera, even with the ConstantID script attached, does not get active on load when playing on the iPad - or that the camera's settings (follow player etc.) do not kick in. In this particular scene I just have the one camera.

    In Unity it works properly.

    Let me know if there are other things I could do to test this out to see what can be wrong.

    EDIT: I get a 'MainCamera has no MainCamera component.' error in Unity, even though the MainCamera has the Main Camera (script) component added. It still works in the Unity player though.

    EDIT2: I see I have wrongfully tagged the GameCamera2D with MainCamera. I'll remove it and report back.

    EDIT3: Didn't matter. The camera is still stuck on load on iPad.
  • I've gone over and exchanged all MainCamera prefabs with the original that came with AC. No difference.

    I've tried to understand what happens when the camera gets stuck, and it might look as if the camera is stuck in perspective mode instead of orthographic. When I load a saved scene on the iPad, the camera will not follow the player and the view is related to the camera's Z-axis.

    I'll see if I can post a video of it happening later tonight.
  • OK, I think this is a bug in AC.

    I've recreated the same thing in a new project:

    I created a short two-scene game with the assets included in AC. When saving the game from scene A, then walk to scene B and reload the game, the camera gets much too wide and stops following the player. This happens on the iPad, not in the Unity built in player.

    Can you please look into this, Chris? Let me know if you want the scene files so you can see what is going on (or try loading a game on the iPad from another scene than the one the player is in).
  • I think I've located the source of this bug:

    In the Player settings, if the Configuration -> Scripting Backend is set to Mono2X, the save files will not save the active camera. Just switching this setting over to IL2CPP fixed this for my projects. Yay!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.