2D side scrolling game stutter/jerk/lag issue when run on iOS devices

Hey Guys!

Project Scenario :
→ 2D side scrolling game with simple 2d sprites
→ Camera is orthographic and stays in its place (camera doesn’t move)
→ My Character (A camel) is also static and does not move.
→ The sprites (Platforms) move from right to left (movement done by script)
→ Project Video is uploaded here (running on iphone5). It clearly shows the small hiccups and jerks.

Issue :
The game works very smoothly on Android devices and Unity Editor (no spikes on the Unity profiler as well)
But, when i run it on iOS devices (iphone5, iphon5s) the motion of my sprites is jerky. Like it will move smoothly for like 1 second and then a small hiccup/jerk of a split second occurs. This results in lag and lagging motion of the game which is very annoying as i am unable to get the right quality for iOS.

Things i have tried :
→ I have studied many possible solutions on various threads and forums but none issue seems to be working for me :frowning:
→ I have tried different scripting techniques like use Lerp function for movement, tried putting the code in LateUpdate and also FixedUpdate.
→ I also turned off vSync in project Quality settings but no luck :frowning:
→ I also tried the movement without the script by making an animation of the sprites to move from right to left.
→ I tried making the project from the latest Unity 5.1 as well but still the same lag :frowning:
→ I tried reducing the sprite sizes to very low (low quality pixels) but still issue prevailed.
→ I also tried to change the camera to perspective view to see if it reduces the jerk or not

I am sure lots of other people around must have faced this issue while making a 2D game of such sort.
I hope someone must have overcome the issue and can please help me with this. This has been an issue with me for long now …

I would really appreciate any help … any new technique in unity or any better optimised logic of making such a 2D game in Unity. Thanks.

Looking forward to some real help.

2 Likes

You can run the profiler remotely on your iOS device too, perhaps that can help pin down the source of the stutter?

Steps to run it on your device here:

Did you solve??

Yes i figured it was the implementation technique. It was way back in unity 5. Now unity seems to have optimised as well.

Basically doing profiling is the best approach.
Try to follow the physics textbook stuff that unity provides. Try to have the best optimised code for memory management and sprites handling. Smooth lerping and savoid spikes in the profiler

If I am not wrong, on iOS devices unity caps FPS at 30 by default to conserve battery etc.

In this case comparing game that runs probably around 60 fps at android vs 30 on iOS, it will looks jittery.

You can set your target frame rate:

Is unity, generally speaking, poor performing on iOS devices? @Matthewek

Performance is just as good, based on experience from my games so far, I have not noticed considerable difference.

Just pointed out that I believe by default unity caps max fps on iOS to 30 - that might give false impression that game runs slow for some people - thinking performance is bad. It of course depends on game type, it can be especially noticeable on some fast peace games, where some more static games are perfectly fine with 30 FPS, everybody should find their perfect balance.

compared to what? I’m comparing to SpriteKit, SceneKit and cocos2D-X

hey muneebatta ,
can you be explained in more detailed , how did you solve this stuttering problem ?
thanks in advance