My game works fine on android devices but freezes on IOS devices

Hello,

Problem: it works with low fps. When I move the screen to move the player to the right or left, it detects the movement after 3 or 4 seconds.

I have this problem on IOS devices.

The package I used: Toony Colors ( i doubt that )

There is no problem in the codes I wrote. I’ve reviewed them all. I was careful when doing the Time.deltaTime and Time.fixedDeltaTime operations.

The script below is running 3 or 4 seconds late. (I called within the Update method)

 public void Turn()
    {
        if (TouchController.Instance.canMove)
        {
            swap = TouchController.Instance.getTouchPosition.x;
          
            if (isDamageRightBorder || isDamageLeftBorder)
            {
                swap = 0;
            }
        }
        else
        {
            swap = 0;
        }

        if (Mathf.Abs(swap) < .9)
        {
            swap = 0;
        }
 
     
        turn.SetTurnValue(swap * direction).SetFrame(Time.deltaTime).Execute();
    }

I checked the necessary optimization settings by watching the video below

Player Settings :

*Target DPI : 310

Others :

Quality :

If you DO have a problem, there is only ONE way to find out. Always start by using the profiler:

Window → Analysis → Profiler

Failure to use the profiler first means you’re just guessing, making a mess of your code for no good reason.

Not only that but performance on platform A will likely be completely different than platform B. Test on the platform(s) that you care about, and test to the extent that it is worth your effort, and no more.

Remember that optimized code is ALWAYS harder to work with and more brittle, making subsequent feature development difficult or impossible, or incurring massive technical debt on future development.

Notes on optimizing UnityEngine.UI setups:

At a minimum you want to clearly understand what performance issues you are having:

  • running too slowly?
  • loading too slowly?
  • using too much runtime memory?
  • final bundle too large?
  • too much network traffic?
  • something else?

If you are unable to engage the profiler, then your next solution is gross guessing changes, such as “reimport all textures as 32x32 tiny textures” or “replace some complex 3D objects with cubes/capsules” to try and figure out what is bogging you down.

Each experiment you do may give you intel about what is causing the performance issue that you identified. More importantly let you eliminate candidates for optimization. For instance if you swap out your biggest textures with 32x32 stamps and you STILL have a problem, you may be able to eliminate textures as an issue and move onto something else.

This sort of speculative optimization assumes you’re properly using source control so it takes one click to revert to the way your project was before if there is no improvement, while carefully making notes about what you have tried and more importantly what results it has had.

1 Like

Hello, first of all thank you for your clarifications.

I created a different algorithm by completely changing the algorithm of the game. The problem is fixed. However, there was no idea about why the problem occurred, other than assumptions.

Since I do not have a Macbook computer, I could not actively test the game in profiles. I was having the problem only on an ios device. I had this problem because ios’s cpu architecture is different from andiod’s cpu architecture.

I always thought that the ios cpu architecture was much better than the cpu architectures of android devices.That’s why I was thinking that the game that runs optimized on Android will run smoothly on all kinds of iOS.

Thank you very much for taking the time to reply. I will act in the light of the information you have given in my next games.