- Home /
Game works fine for about a minute or two but then the frame rate drops
I'm making a clone based on this game:
The idea is that platforms are moving up across the screen and the player has to keep the ball on the platforms. If the ball hits any of the spikes, the player loses a life.
I'm making the game for Android. My platforms use Rigidbody.MovePosition() to move across the screen. The platforms' rigidbodies have Interpolate set to "Interpolate" and isKinematic set to "true". I even have a background that uses the same function to move across the screen. My ball uses Rigidbody.AddForce() to move around. So as you can see, pretty much everything in my scene is moving around with physics and rigidbodies.
On Android, the game runs perfectly. But after a minute or two, the frame rate drops and the platforms' movement becomes more jitter-y.
I initially thought that maybe something is building up in my scene. But I don't know how that's possible given that I'm using object pooling for pretty much everything. No object is being instantiated not destroyed. They're just being enabled and disabled constantly. So why the stutter in the middle of my game? Is there anything that is building up in the game scene which I'm not aware of?
What does your profiler say that's eating up your resources?
According to the profiler, it's Gfx.WaitForPresent that's causing the problem.
Your answer
Follow this Question
Related Questions
Low FPS at low CPU usage 0 Answers
What is postupdatescreenmanagerandinput? 0 Answers
trying to make 2D water without dropping frame rate. 1 Answer