Alexander Kucherenko
Alexander Kucherenko

Reputation: 451

Unity sudden FPS drop

I am developing a simple 3D mobile game using Unity. I am targeting 30 FPS without vsync. My game runs good on all iOS devices without heating and throttling but there are weird FPS drops. Suddenly FPS drops to 20 and after several seconds it is 30 again. This strange thing occurs every 10-20 seconds and it’s absolutely weird because my profiler shows smooth rendering stats. Can anyone help me?

Upvotes: 1

Views: 3414

Answers (2)

Alexander Kucherenko
Alexander Kucherenko

Reputation: 451

After a short research I found a solution! This FPS drop occurs when GPU renders on full screen resolution. So I decreased my phone's screen resolution.

void Awake() {
    var resolution = Screen.currentResolution;
    var height = (int)(resolution.height * 0.65f);
    var width = (int)(resolution.width * 0.65f); 
    Screen.SetResolution(height, width, true);
}

Now my game works perfect on all iOS and Android devices without throttling and heating even after long sessions.

Upvotes: 0

jason.dachman
jason.dachman

Reputation: 34

I seem to remember a similar issue when unity was using it's auto blending feature. Try turning that off and see if you notice a difference

Upvotes: 1

Related Questions