27
« on: May 20, 2013, 01:15:11 am »
I'm doing my first professional game for Android, and I think your product was the best one for this situation.
I did some basic tests for Android. And I've got something VERY strange. When I first "build and run" with my device connected, the game ran JUST FINE. But when I quit it, and reopened, the sprites starts flashing forever (just the static-ones, not the animated ones). I thought it must be some caching problem. But even when I restarted my DEVICE, the sprites are STILL flashing. So, I uninstalled the app, installed again AND - first time running, perfect. Exit, open again, sprites flashing forever. What the hell? My game only works in the first time!
So I continued my tests, this time, messing with the "player settings". And I got something curious. When I turn OFF the "Dynamic batching", the game runs just fine. In the first time, second, third, well... the way it always should have worked. So I thought "well... let's just keep this box unchecked". But... It would be very good that this option stays checked, 'cos I know it increases the game performance. So, you guys could explain to me what these flashing are? And why do they happen? And how can I fix this?
So, the problem is that. I'm going to explain what my tests are - I have 2 prefabs, the first is a "Walls" prefab, and the 2nd is a "Powerups" prefab. These two prefabs are associated with two variables of a Scenario.cs script, which belongs to a GameObject in the scene.
The Scenario.cs script has...
public GameObject wallsPrefab;
public GameObject powerupsPrefab;
The scenario is responsible for creating the GameObjects of the prefabs and moving them along the x-axis. From the right boundarie of the screen to the left. When the sprites get all the way left, they are destroyed.
And that's it. Objects generated from two distinct prefabs that moves from the right side of the screen to the left. These sprites flash all over the scene when the game is run after the first time. And this does not happen when Dynamic Batching is OFF.
Oh yeah, my device is a Motorola Defy (kind of old, but still).
Waiting for an answer. Thanks.