Search Unity

Ios strange lags

Discussion in 'iOS and tvOS' started by Svova9, Aug 12, 2018.

  1. Svova9

    Svova9

    Joined:
    Mar 29, 2018
    Posts:
    3
    So I have recently builded a game on my iPhone X. On the android(any smartphone) and editor all works fine, game and menu animations are very smooth. But on my Iphone (it happens like once in 10 lvls) game runs like in slow mo(game is twice slower) and UI animations are laggy.It often happens when I hide my game or after ads session.The interesting thing is when I record screen(using iPhone default screen recorder in iOS 11) this "slow-mo" stops, it also stops after restarting lvl(but sometimes it doesn't ) and when I pull down iPhone "curtain".
    Also it needed to be said that my game is 2D and don't have any advanced graphics . I have set a targetFrameRate to 60 and turned Vsync off, also In quality setting chose a "Fast ", but it didn't help.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    I recommend you use profiling tools to measure what is causing your game to run slow on the iPhone.

    Also remember that running an app with 60fps normally heats up the phone quickly and new phones often throttle back performance in this case, to cool down again. See the thermal stability link at the bottom of this post.

    Here are a few resources that should help you to get started with the Unity Profiler.

    Learn how to diagnose common performance problems and optimize your projects:
    https://unity3d.com/learn/tutorials/topics/performance-optimization




    Mobile performance handbook: Thermal stability
    https://forum.unity.com/threads/profiling-and-optimisation-tips-for-mobiles.512902/
     
  3. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Wait a second, let me get my tin foil hat, I think we're on to something here!

    In all seriousness, I do see the same problem. I did quite a lot of documentation on it here: https://forum.unity.com/threads/performance-problems-switching-back-to-app-iphonex.535783/

    I'm wondering however how this is only a problem for some (at least it seams so). One thing I found is that 30 fps games do not have the problem and that the problem stays longer when the CPU GPU has a lot of stuff to do. Sadly I was not able to dive too much into the problem, since it takes a lot of time to precisely nail down the cause. Maybe you can find similarities of your project or data that matches mine. If you want tto continue where I left off, profile with XCode Instruments (Time Profiler).
     
  4. Svova9

    Svova9

    Joined:
    Mar 29, 2018
    Posts:
    3
    So have you managed to do smth with this bug? Can the problem be only with my own iPhone, and on other it should run fine. I am actually very afraid that the problem is with Unity or Xcode and what I supposed to do then?