Game logic not updating on mobile devices

Hello, I’m getting a strange bug when I run my game on any mobile platforms (andriod, iPhone, iPad). For some reason, when I run my game on a mobile device, if your not touching the screen it’s not updating the game logic. If I run my game on the web, or as a PC standalone, everything runs fine however.

For example, I have some monsters randomly spawning around the screen, walking towards the middle of the screen, and when they hit the middle of the screen, they explode. If the user isn’t constantly touching the screen, the monsters don’t spawn (only if they are touching the screen, do they spawn). Also, if the user doesn’t touch the screen for awhile, then touches the screen, all the sudden, all the monsters that were supposed to spawn during that period in which the user doesn’t touch the screen, all spawn at once, as if all the updates for monster spawning were queued up until the user touched the screen.

I have no idea why this is happening. Has anyone else had similar issues, or have an idea as to how to fix this problem?

Haven’t seen anything like that… Maybe post some code snippets…

http://forum.unity3d.com/threads/90237-Reflective-Vertexlit-shader-looks-different-on-iPhone-3G-and-3GS?p=584018&viewfull=1#post584018

I really am curious. Without giving away my own stance, my way of thinking seemed to be mirrored by several people I talked to. However, they were all local. Is this not a universal internet maxim?

I would post some code if I knew where this was happening :(. I have a lot of code and a lot going on in my game, and don’t even know where I would start looking for a bug like this.

You can start looking by placing Debug.Log statements into your code. Start with the piece of code that’s not being run and work backwards to the place that method or piece of code would be called. Put a debug.log statement in and determine if the calling function is being called. If it is, then start breaking that function up to see which part does not execute exactly as you expect. If it isn’t, then go back to the function that called this function and try again. Repeat until you’ve tracked down the function which is running, but it’s not behaving as expected.

This, among other techniques, is how you debug any bug of unknown origin.

EDIT: in case you weren’t aware, calls to Debug.Log are executed on iOS. You can retrive the logs from a connected device in XCode. It’s under Window>Organizer>Console or something like that.