- Home /
Game stuttering
I'm making a 2D side scrolling game and my game is stuttering. It's very strange, since i have constant ~60 fps per second.
After spending a few hours of trying around, i ended up with the player character alone (allother objects disabled), and it still stutters on my Galaxy S3.
Here's a link to the APK http://www.talantyyr.at/FlippingBeaver.apk
All there's left is an animated sprite, with a Rigidbody 2D attached. (Mass 1, Linar Drag 0, Angular Drag 1, Gravity Scale 2, isKinematic true, interpolate none, sleeping mode start awake)
All i do to move the beaver is
myCharacter.rigidbody2D.AddForceAtPosition(Vector2.up, new Vector2(-1, 0));
Strange thing is, that the framerate doesn't drop...
Edit: I've tested the scene i've uploaded on my Tablet (Asus Memo Pad HD7) and there's no stuttering at all... Then i've tried the complete game on the tablet (Older version, where i use instantiate instead of using gameobjects from a pool) and even that version runs perfectly fine on the asus memo pad, which has less powerful hardware than the S3.
Could it be, that there's a problem with the Galaxy S3? My Wife has the same phone and i've tested it on both devices with the exact same result. Is there something known about this?
Do you have any dynamic fonts in the game? That gave me that issue, as every time a new letter or number is rendered, a new texture is created and it can cause a CPU spike.
I've read about that already and disabled all texts for testing purposes.
I guess it must be something device specific, since it runs very smooth on my Tablet. I've also tested the whole game (including dynamic fonts) on a friends nexus 4 device today and it also runs perfectly fine on his device.
Best not to use dynamic fonts at all on mobiles as some devices just hate them.
yeah, but it's still stuttering on the Galaxy S3, even with no dynamic fonts. :(
Answer by Talantyyr · Feb 25, 2014 at 06:34 PM
Problem solved. When i started the project, i enabled "Multithreaded rendering"... it sounded like a good idea :) In fact, it wasn't.
I'm just happy that the problem occured on my device and not after releasing the game.
Now i've finished Flipping Beaver and released it to Google Play.
Answer by matra · Feb 19, 2014 at 10:43 PM
I had a similar problen chaning mass of Rigidbody to minimum (0.0001) and Gravity Sacle to 0 has fixed the problem for me. However, I was not using AddForceAtPosition, I am moving the object by explicitla setting it's transform (I do not need to use Physics).
Your answer